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

Comments

Projects
None yet
2 participants
@lbonn
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 SSL/TLS label Aug 2, 2018

@bagder

This comment has been minimized.

Show comment
Hide comment
@bagder

bagder Aug 2, 2018

Member

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?

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

This comment has been minimized.

Show comment
Hide comment
@lbonn

lbonn Aug 2, 2018

Contributor

Yes, I can take a shot.

Contributor

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

vtls: reinstantiate engine on duplicated handles
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 #2829

lbonn added a commit to lbonn/curl that referenced this issue Aug 2, 2018

vtls: reinstantiate engine on duplicated handles
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 #2829

lbonn added a commit to lbonn/curl that referenced this issue Aug 3, 2018

vtls: reinstantiate engine on duplicated handles
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 #2829

lbonn added a commit to lbonn/curl that referenced this issue Aug 6, 2018

vtls: reinstantiate engine on duplicated handles
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 #2829

lbonn added a commit to lbonn/curl that referenced this issue Aug 6, 2018

vtls: reinstantiate engine on duplicated handles
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 #2829

lbonn added a commit to lbonn/curl that referenced this issue Aug 7, 2018

vtls: reinstantiate engine on duplicated handles
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 #2829

lbonn added a commit to lbonn/curl that referenced this issue Aug 17, 2018

vtls: reinstantiate engine on duplicated handles
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 #2829

@bagder bagder closed this in 4939f36 Aug 18, 2018

xquery added a commit to xquery/curl that referenced this issue Sep 3, 2018

vtls: reinstantiate engine on duplicated handles
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 #2829
Closes #2833

falconindy added a commit to falconindy/curl that referenced this issue Sep 10, 2018

vtls: reinstantiate engine on duplicated handles
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 #2829
Closes #2833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment