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

How to set capath? #374

Open
LucasAndrad opened this issue Jan 3, 2019 · 4 comments
Open

How to set capath? #374

LucasAndrad opened this issue Jan 3, 2019 · 4 comments

Comments

@LucasAndrad
Copy link

I already try:

response = Curl::Easy.new(URL_FORM)
response.set(Curl::CURLOPT_CAPATH, "/etc/ssl/certs") 
# and
response.set(:capath, "/etc/ssl/certs")

But every time I got the same error:
Curb doesn't support setting capath [#10097] option

And without capath:

CApath: none
OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection

I'm using:
Ruby 2.5.1
Rails 5.2.2
curb (0.9.7, 0.9.6)

@robuye
Copy link
Contributor

robuye commented Jan 9, 2019

I took a look at the sources and it appears CURLOPT_CAPATH constant is defined, but it's setting it is not implemented so the error. I can take a look what it takes to implement it. Are there more related curl options worth pulling to curb while I'm at it?

@LucasAndrad
Copy link
Author

Actually I only checked this option of Curl

@robuye
Copy link
Contributor

robuye commented Jan 15, 2019

I'm still trying to come up with a good implementation, but it's tricky because the options I'm adding are passed to the SSL backend and I'm running into errors on different platforms 🙈

While I'm still on it you may consider a workaround using easy.cacert=. That means manual file lookup so it may or may not work for you.

The example code you provided points capath to a default location and curl should be always using it, unless explicitly compiled without it. The SSL_ERROR_SYSCALL probably isn't coming from libcurl itself, but from OpenSSL for some reason.

Do you have the curl binary available? Can you see if it works? curl -svo /dev/null --capath /etc/ssl/certs <URL_FORM> (and then maybe curl -svo /dev/null <URL_FORM> to test if it's compiled with the default CA store).

@robuye
Copy link
Contributor

robuye commented Jan 15, 2019

you may also use curl-config --ca to see default ca bundle curl uses.

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