Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL Verify #30

Open
lawless-m opened this issue Sep 28, 2016 · 3 comments
Open

SSL Verify #30

lawless-m opened this issue Sep 28, 2016 · 3 comments

Comments

@lawless-m
Copy link

lawless-m commented Sep 28, 2016

Hi,

I'm trying to connect via a Proxy (inside corp network, I can't choose not to)
I have, of course, replaced the USER PASS & PROXY_URL text
First the error message, perhaps this is the wrong place to report it so there would be no point reading the rest :)

Assertion failure: 0 != rv, at ntio.c:1803

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in > their entirety). Thanks.
Exception: EXCEPTION_BREAKPOINT at 0x7ff9caa7e0e2 -- DebugBreak at C:\windows\system32\KERNELBASE.dll (unknown line)
DebugBreak at C:\windows\system32\KERNELBASE.dll (unknown line)

So here I am submitting this bug report. Can I also add that if it is a Julia error message, it should include a guide to where to report this bug. Thanks

My code :

using HTTPClient.HTTPC
using LibCURL

const CHECK_SSL = false

function customize_curl(curl)
        # removed error trapping for clarity
    LibCURL.curl_easy_setopt(curl, LibCURL.CURLOPT_PROXY, "http://USER:PASS@PROXY_URL")
    LibCURL.curl_easy_setopt(curl, LibCURL.CURLOPT_PROXYPORT, 8080)
    LibCURL.curl_easy_setopt(curl, LibCURL.CURLOPT_SSL_VERIFYPEER, CHECK_SSL)
end

r = HTTPC.get("https://news.ycombinator.com/news", 
    RequestOptions(request_timeout=5.0,callback=customize_curl)
)
println(r)

if CHECK_SSL is true I get

ERROR: LoadError: "Error executing request : Problem with the SSL CA cert (path? access rights?)"

which is a known problem, but to see here how to set options for CA checking
https://curl.haxx.se/docs/sslcerts.html

Tell libcurl to not verify the peer. With libcurl you disable this with curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);
With the curl command line tool, you disable this with -k/--insecure.

so I added CHECK_SSL and set to false and then get the error message at the top.

@bluesmoon
Copy link

Instead of setting CHECK_SSL to false, try this instead: curl_easy_setopt(curl, CURLOPT_CAINFO, LibCURL.cacert)

@bluesmoon
Copy link

If your proxy server has a self-signed certificate, then you will need the proxy's cacert file instead.

@lawless-m
Copy link
Author

Thanks for the help. Unfortunately that was 3 jobs ago, in another country. So I am no longer able to test the proposed solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants