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

duphandle doesn't preserve CURLOPT_SSLENGINE #2829

Closed
lbonn opened this issue Aug 2, 2018 · 2 comments
Closed

duphandle doesn't preserve CURLOPT_SSLENGINE #2829

lbonn opened this issue Aug 2, 2018 · 2 comments
Labels

Comments

@lbonn
Copy link
Contributor

lbonn commented Aug 2, 2018

Similar to #2485, an option is not propagated to duplicated handles.

I did this

CURL *curl = curl_easy_init(), *curl_clone;
curl_easy_setopt(curl, CURLOPT_SSLENGINE, "pkcs11");

curl_clone = curl_easy_duphandle(curl);

...

curl_easy_perform(curl_clone);

I expected the following

curl_easy_perform uses the specified SSL engine. In reality, curl_easy_setopt needs to be called again on the cloned handle to make it work.

curl/libcurl version

curl -V
curl 7.61.0 (x86_64-pc-linux-gnu) libcurl/7.61.0 OpenSSL/1.0.2o zlib/1.2.11
Release-Date: 2018-07-11
Protocols: file ftp ftps http https
Features: AsynchDNS IPv6 Largefile NTLM SSL libz TLS-SRP UnixSockets HTTPS-proxy

operating system

Linux

@bagder bagder added the TLS label Aug 2, 2018
@bagder
Copy link
Member

bagder commented Aug 2, 2018

Confirmed. I think we need to store the name separately so that we can set it again when dup'ed...

@lbonn are you interested in making a PR to fix this?

@lbonn
Copy link
Contributor Author

lbonn commented Aug 2, 2018

Yes, I can take a shot.

lbonn added a commit to lbonn/curl that referenced this issue Aug 2, 2018
Handles created with curl_easy_duphandle do not use the SSL engine set
up in the original handle. This fixes the issue by storing the engine
name in the internal url state and setting the engine from its name
inside curl_easy_duphandle.

Discovered-by: Anton Gerasimov
Closes curl#2829
lbonn added a commit to lbonn/curl that referenced this issue Aug 2, 2018
Handles created with curl_easy_duphandle do not use the SSL engine set
up in the original handle. This fixes the issue by storing the engine
name in the internal url state and setting the engine from its name
inside curl_easy_duphandle.

Reported-by: Anton Gerasimov
Reported-by: Laurent Bonnans
Closes curl#2829
lbonn added a commit to lbonn/curl that referenced this issue Aug 3, 2018
Handles created with curl_easy_duphandle do not use the SSL engine set
up in the original handle. This fixes the issue by storing the engine
name in the internal url state and setting the engine from its name
inside curl_easy_duphandle.

Reported-by: Anton Gerasimov
Signed-of-by: Laurent Bonnans
Closes curl#2829
lbonn added a commit to lbonn/curl that referenced this issue Aug 6, 2018
Handles created with curl_easy_duphandle do not use the SSL engine set
up in the original handle. This fixes the issue by storing the engine
name in the internal url state and setting the engine from its name
inside curl_easy_duphandle.

Reported-by: Anton Gerasimov
Signed-of-by: Laurent Bonnans
Closes curl#2829
lbonn added a commit to lbonn/curl that referenced this issue Aug 6, 2018
Handles created with curl_easy_duphandle do not use the SSL engine set
up in the original handle. This fixes the issue by storing the engine
name in the internal url state and setting the engine from its name
inside curl_easy_duphandle.

Reported-by: Anton Gerasimov
Signed-of-by: Laurent Bonnans
Closes curl#2829
lbonn added a commit to lbonn/curl that referenced this issue Aug 7, 2018
Handles created with curl_easy_duphandle do not use the SSL engine set
up in the original handle. This fixes the issue by storing the engine
name in the internal url state and setting the engine from its name
inside curl_easy_duphandle.

Reported-by: Anton Gerasimov
Signed-of-by: Laurent Bonnans
Closes curl#2829
lbonn added a commit to lbonn/curl that referenced this issue Aug 17, 2018
Handles created with curl_easy_duphandle do not use the SSL engine set
up in the original handle. This fixes the issue by storing the engine
name in the internal url state and setting the engine from its name
inside curl_easy_duphandle.

Reported-by: Anton Gerasimov
Signed-of-by: Laurent Bonnans
Closes curl#2829
@bagder bagder closed this as completed in 4939f36 Aug 18, 2018
xquery pushed a commit to xquery/curl that referenced this issue Sep 3, 2018
Handles created with curl_easy_duphandle do not use the SSL engine set
up in the original handle. This fixes the issue by storing the engine
name in the internal url state and setting the engine from its name
inside curl_easy_duphandle.

Reported-by: Anton Gerasimov
Signed-of-by: Laurent Bonnans
Fixes curl#2829
Closes curl#2833
falconindy pushed a commit to falconindy/curl that referenced this issue Sep 10, 2018
Handles created with curl_easy_duphandle do not use the SSL engine set
up in the original handle. This fixes the issue by storing the engine
name in the internal url state and setting the engine from its name
inside curl_easy_duphandle.

Reported-by: Anton Gerasimov
Signed-of-by: Laurent Bonnans
Fixes curl#2829
Closes curl#2833
@lock lock bot locked as resolved and limited conversation to collaborators Nov 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants