{"id":1009,"date":"2014-12-18T16:20:57","date_gmt":"2014-12-18T16:20:57","guid":{"rendered":"http:\/\/www.nikola-breznjak.com\/blog\/?p=1009"},"modified":"2015-08-16T20:05:18","modified_gmt":"2015-08-16T20:05:18","slug":"webkitdotnet-unable-to-load-https-site","status":"publish","type":"post","link":"https:\/\/nikola-breznjak.com\/blog\/stack-overflow\/webkitdotnet-unable-to-load-https-site\/","title":{"rendered":"Webkitdotnet unable to load https site"},"content":{"rendered":"<p><a href=\"http:\/\/stackoverflow.com\/users\/534755\/nikola\"><img loading=\"lazy\" decoding=\"async\" title=\"profile for Nikola at Stack Overflow, Q&amp;A for professional and enthusiast programmers\" src=\"http:\/\/stackoverflow.com\/users\/flair\/534755.png\" rel=\"lightbox[1009]\" alt=\"profile for Nikola at Stack Overflow, Q&amp;A for professional and enthusiast programmers\" width=\"208\" height=\"58\" \/><\/a><br \/>\nI&#8217;m a big fan of <a href=\"http:\/\/stackoverflow.com\/\">Stack Overflow<\/a> and I tend to contribute regularly (am currently in the <a href=\"http:\/\/stackexchange.com\/leagues\/1\/alltime\/stackoverflow\/2008-07-31\/534755?sort=reputationchange#534755\">top 0.X%<\/a>).\u00a0In this category (<a href=\"http:\/\/www.nikola-breznjak.com\/blog\/category\/stack-overflow\/\">stackoverflow<\/a>)\u00a0of posts I will will be posting my top rated questions and answers. This, btw, is allowed as explained in the meta thread <a href=\"http:\/\/meta.stackoverflow.com\/questions\/266971\/can-i-post-so-questions-and-answers-in-a-personal-blog\/266973\">here<\/a>.<\/p>\n<p>My <a href=\"http:\/\/stackoverflow.com\/questions\/5579631\/webkitdotnet-unable-to-load-https-site\">quesiton<\/a> was:<\/p>\n<p style=\"color: #000000;\">I am using this\u00a0<a style=\"color: #4a6b82;\" href=\"http:\/\/sourceforge.net\/projects\/webkitdotnet\" rel=\"nofollow\">webkitdotnet<\/a>\u00a0in my C# project. It all went well until I had to use access site with https.<\/p>\n<p style=\"color: #000000;\">I&#8217;ve searched their forum and found\u00a0<a style=\"color: #4a6b82;\" href=\"http:\/\/sourceforge.net\/projects\/webkitdotnet\/forums\/forum\/939856\/topic\/3345480\" rel=\"nofollow\">few posts<\/a>\u00a0about this but none of it solves my problem, so please shed some light on this one. Thx!<\/p>\n<p style=\"color: #000000;\">edit: Also as mentioned in their threads (also without an answer) I get a &#8220;Peer certificate cannot be authenticated with known CA certificates&#8221; error when trying to access my server, but<a style=\"color: #4a6b82;\" href=\"https:\/\/www.google.com\/\" rel=\"nofollow\">https:\/\/www.google.com<\/a>\u00a0works fine.<\/p>\n<p style=\"color: #000000;\">They also mention the &#8220;apple&#8221; build which worked fine with ssl (at least so they say), but I can&#8217;t find it anywhere&#8230;<\/p>\n<p>The answer, by <a href=\"http:\/\/stackoverflow.com\/users\/317754\/therealmitchconnors\">therealmitchconnors<\/a>,\u00a0was:<\/p>\n<blockquote><p>This is a bit of a hack, but you can make webkitdotnet ingore peer ssl errors. WebKitDotNet uses WebKit, which, in turn uses curl, which is responsible for your wonderful ssl error there. curl exposes an option to ignore ssl errors, but neither webkit nor webkitdotnet seem to expose this functionality in their api. However, if you checkout the webkit source code, webkit sets the curl option (CURLOPT_SSL_VERIFYPEER) to false if the value of the environment variable WEBKIT_IGNORE_SSL_ERRORS is set to true.<\/p>\n<p>What this all boils down to is that\u00a0<strong>if you set the environment variable in code before initializing either webkit or webkitdotnet components, webkit will ignore the bad certificate and allow you to navigate to the site<\/strong>\u00a0(sort of like clicking Proceed Anyway on IE9&#8217;s Bad Certificate Warning page).<\/p>\n<p>C++:<\/p>\n<pre><code>setvar(\"WEBKIT_IGNORE_SSL_ERRORS\", \"1\");\r\n<\/code><\/pre>\n<p>C#:<\/p>\n<pre><code>Environment.SetEnvironmentVariable(\"WEBKIT_IGNORE_SSL_ERRORS\", \"1\");\r\n<\/code><\/pre>\n<p>If anyone is interested, the webkit source code referenced is in file webkit\\Source\\WebCore\\platform\\network\\curl\\ResourceHandleManager.cpp at lines 65 and 681, currently.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m a big fan of Stack Overflow and I tend to contribute regularly (am currently in the top 0.X%).\u00a0In this category (stackoverflow)\u00a0of posts I will will be posting&hellip;<\/p>\n","protected":false},"author":1,"featured_media":609,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-1009","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stack-overflow"],"_links":{"self":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/1009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/comments?post=1009"}],"version-history":[{"count":2,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/1009\/revisions"}],"predecessor-version":[{"id":1697,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/1009\/revisions\/1697"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media\/609"}],"wp:attachment":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media?parent=1009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/categories?post=1009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/tags?post=1009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}