curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: code: 35 (SSL connect error) issue when using newer curl version(?)

From: Daniel Hallberg via curl-library <curl-library_at_lists.haxx.se>
Date: Tue, 6 Dec 2022 10:56:27 +0100

Den 2022-11-24 kl. 11:31, skrev Daniel Stenberg:
>
> Do you run with CURLOPT_VERBOSE set? Checked the CURLOPT_ERRORBUFFER?
> They might offer some extra clues for the error.
>
> Off the top of my head I can't think of any obvious reasons you would
> get this due to such an upgrade.
>

I have a hard time solving this problem. It seems to hit sometimes when
multiple threads fetch simultaniously.
I think I must be doing something wrong but that I've always been
"lucky" so far, but now when something in the environment changed it breaks.

I've found out that I don't set memory callbacks with
curl_global_init_mem, but should/must I..?

One problem for me is that I don't know how curls debug output *should*
look, so I don't know if what I see is expected or not.
Do you see anything suspicious..?
Is there some way to enable even more curl debug output?

2022-12-06 08:24:58.367210 [ Thread: 140072316313728 ] INFO: libcurl info:
2022-12-06 08:24:58.367227 [ Thread: 140072316313728 ] INFO:  -> age: 9
2022-12-06 08:24:58.367233 [ Thread: 140072316313728 ] INFO:  ->
version: 7.86.0
2022-12-06 08:24:58.367237 [ Thread: 140072316313728 ] INFO:  ->
ssl_version: OpenSSL/3.0.2
2022-12-06 08:24:58.367245 [ Thread: 140072316313728 ] INFO:  ->
features: ALTSVC ASYNCHDNS HSTS HTTP2 HTTPS_PROXY IPV6 LARGEFILE LIBZ
NTLM NTLM_WB SSL THREADSAFE TLSAUTH_SRP UNIX_SOCKETS
2022-12-06 08:24:58.367263 [ Thread: 140072316313728 ] INFO:  ->
libz_version: 1.2.11
2022-12-06 08:24:58.367274 [ Thread: 140072316313728 ] INFO:  ->
protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt
pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
2022-12-06 08:24:58.367278 [ Thread: 140072316313728 ] INFO:  -> ares:
1.18.1
2022-12-06 08:24:58.367285 [ Thread: 140072316313728 ] INFO:  -> libidn: 0
2022-12-06 08:24:58.367290 [ Thread: 140072316313728 ] INFO:  ->
libssh_version: 0
2022-12-06 08:24:58.367294 [ Thread: 140072316313728 ] INFO:  ->
brotli_version: 0
2022-12-06 08:24:58.367298 [ Thread: 140072316313728 ] INFO: OpenSSL
threading supported
...
(multiple "working" calls in the debug output removed)
...
2022-12-06 08:25:15.053341 [ Thread: 140071097333312 ] INFO: ssl_lock_cb
locking 0x5566a5dadb60
2022-12-06 08:25:15.053385 [ Thread: 140071097333312 ] INFO:
ssl_unlock_cb released 0x5566a5dadb60
[140071097333312] == Info:   Trying nnn.nnn.nnn.nnn:443...
[140071097333312] == Info: Connected to xxx.xxx.se () port 443 (#0)
2022-12-06 08:25:15.068292 [ Thread: 140071046977088 ] INFO: ssl_lock_cb
locking 0x5566a5dadb60
2022-12-06 08:25:15.068337 [ Thread: 140071046977088 ] INFO:
ssl_unlock_cb released 0x5566a5dadb60
[140071046977088] == Info:   Trying nnn.nnn.nnn.nnn:443...
[140071046977088] == Info: Connected to xxx.xxx.se () port 443 (#0)
2022-12-06 08:25:15.105592 [ Thread: 140071005013568 ] INFO: ssl_lock_cb
locking 0x5566a5dadb60
2022-12-06 08:25:15.105623 [ Thread: 140071005013568 ] INFO:
ssl_unlock_cb released 0x5566a5dadb60
[140071005013568] == Info:   Trying nnn.nnn.nnn.nnn:443...
[140071005013568] == Info: Connected to xxx.xxx.se () port 443 (#0)
2022-12-06 08:25:15.174395 [ Thread: 140070988228160 ] INFO: ssl_lock_cb
locking 0x5566a5dadb60
2022-12-06 08:25:15.174443 [ Thread: 140070988228160 ] INFO:
ssl_unlock_cb released 0x5566a5dadb60
[140070988228160] == Info:   Trying nnn.nnn.nnn.nnn:443...
2022-12-06 08:25:15.186235 [ Thread: 140070963050048 ] INFO: ssl_lock_cb
locking 0x5566a5dadb60
2022-12-06 08:25:15.186289 [ Thread: 140070963050048 ] INFO:
ssl_unlock_cb released 0x5566a5dadb60
[140070988228160] == Info: Connected to xxx.xxx.se () port 443 (#0)
[140070963050048] == Info:   Trying nnn.nnn.nnn.nnn:443...
[140070963050048] == Info: Connected to xxx.xxx.se () port 443 (#0)
[140071055369792] == Info: ALPN: offers h2
[140071055369792] == Info: ALPN: offers http/1.1
[140071063762496] == Info: ALPN: offers h2
[140071063762496] == Info: ALPN: offers http/1.1
[140070979835456] == Info: ALPN: offers h2
[140070979835456] == Info: ALPN: offers http/1.1
[140071038584384] == Info: ALPN: offers h2
[140071038584384] == Info: ALPN: offers http/1.1
[140071181194816] == Info: ALPN: offers h2
[140071181194816] == Info: ALPN: offers http/1.1
[140071030191680] == Info: ALPN: offers h2
[140071030191680] == Info: ALPN: offers http/1.1
[140071088940608] == Info: ALPN: offers h2
[140071088940608] == Info: ALPN: offers http/1.1
[140070996620864] == Info: ALPN: offers h2
[140070996620864] == Info: ALPN: offers http/1.1
[140070879123008] == Info: ALPN: offers h2
[140070879123008] == Info: ALPN: offers http/1.1
[140071223158336] == Info: ALPN: offers h2
[140071223158336] == Info: ALPN: offers http/1.1
[140070954657344] == Info: ALPN: offers h2
[140070954657344] == Info: ALPN: offers http/1.1
[140070753396288] == Info: ALPN: offers h2
[140070753396288] == Info: ALPN: offers http/1.1
[140070946264640] == Info: ALPN: offers h2
[140070946264640] == Info: ALPN: offers http/1.1
[140070912693824] == Info: ALPN: offers h2
[140070912693824] == Info: ALPN: offers http/1.1
[140070971442752] == Info: ALPN: offers h2
[140070971442752] == Info: ALPN: offers http/1.1
[140071189587520] == Info: ALPN: offers h2
[140071189587520] == Info: ALPN: offers http/1.1
[140071013406272] == Info: ALPN: offers h2
[140071013406272] == Info: ALPN: offers http/1.1
[140070937871936] == Info: ALPN: offers h2
[140070937871936] == Info: ALPN: offers http/1.1
[140071021798976] == Info: ALPN: offers h2
[140071021798976] == Info: ALPN: offers http/1.1
[140070853944896] == Info: ALPN: offers h2
[140070853944896] == Info: ALPN: offers http/1.1
[140070921086528] == Info: ALPN: offers h2
[140070921086528] == Info: ALPN: offers http/1.1
[140070862337600] == Info: ALPN: offers h2
[140070862337600] == Info: ALPN: offers http/1.1
[140071080547904] == Info: ALPN: offers h2
[140071080547904] == Info: ALPN: offers http/1.1
[140071197980224] == Info: ALPN: offers h2
[140071197980224] == Info: ALPN: offers http/1.1
[140071206372928] == Info: ALPN: offers h2
[140071206372928] == Info: ALPN: offers http/1.1
[140071072155200] == Info: ALPN: offers h2
[140071072155200] == Info: ALPN: offers http/1.1
[140070745003584] == Info: ALPN: offers h2
[140070745003584] == Info: ALPN: offers http/1.1
[140070929479232] == Info: ALPN: offers h2
[140070929479232] == Info: ALPN: offers http/1.1
[140070870730304] == Info: ALPN: offers h2
[140070870730304] == Info: ALPN: offers http/1.1
[140070963050048] == Info: ALPN: offers h2
[140070963050048] == Info: ALPN: offers http/1.1
[140071005013568] == Info: ALPN: offers h2
[140071005013568] == Info: ALPN: offers http/1.1
[140070904301120] == Info: ALPN: offers h2
[140070904301120] == Info: ALPN: offers http/1.1
[140070887515712] == Info: ALPN: offers h2
[140070887515712] == Info: ALPN: offers http/1.1
[140070761788992] == Info: ALPN: offers h2
[140070761788992] == Info: ALPN: offers http/1.1
[140070988228160] == Info: ALPN: offers h2
[140070988228160] == Info: ALPN: offers http/1.1
[140070845552192] == Info: ALPN: offers h2
[140070845552192] == Info: ALPN: offers http/1.1
[140070895908416] == Info: ALPN: offers h2
[140070895908416] == Info: ALPN: offers http/1.1
[140071214765632] == Info: ALPN: offers h2
[140071214765632] == Info: ALPN: offers http/1.1
[140071046977088] == Info: ALPN: offers h2
[140071046977088] == Info: ALPN: offers http/1.1
[140071097333312] == Info: ALPN: offers h2
[140071097333312] == Info: ALPN: offers http/1.1
[140071189587520] == Info:  CAfile: /etc/ssl/certs/ca-certificates.crt
[140071189587520] == Info:  CApath: none
2022-12-06 08:25:25.238499 [ Thread: 140071189587520 ] INFO: ssl_lock_cb
locking 0x5566a5dadb60
[140071189587520] == Info: SSL re-using session ID
2022-12-06 08:25:25.238578 [ Thread: 140071189587520 ] INFO:
ssl_unlock_cb released 0x5566a5dadb60
[140071189587520] == Info: TLSv1.0 (OUT), TLS header, Certificate Status
(22):
[140071189587520] 0000000005 bytes (0x00000005)
[140071189587520] 0000: 16 03 01 02 00                                 
.....
[140071189587520] == Info: TLSv1.3 (OUT), TLS handshake, Client hello (1):
[140071189587520] 0000000512 bytes (0x00000200)
[140071189587520] 0000: 01 00 01 fc 03 03 a1 9a 6f 9b dd 69 96 54 cd 40
........o..i.T._at_

(multiple lines debug output removed)

[140071189587520] == Info: OpenSSL SSL_connect: Connection reset by peer
in connection to xxx.xxx.se:443
[140071189587520] == Info: Closing connection 0
2022-12-06 08:25:25.249838 [ Thread: 140071189587520 ] INFO: ssl_lock_cb
locking 0x5566a5dadb60
2022-12-06 08:25:25.249875 [ Thread: 140071189587520 ] INFO:
ssl_unlock_cb released 0x5566a5dadb60
OpenSSL SSL_connect: Connection reset by peer in connection to
xxx.xxx.se:443
2022-12-06 08:25:25.249901 [ Thread: 140071189587520 ] ERROR: CURLcode:
35 (SSL connect error)
2022-12-06 08:25:25.249915 [ Thread: 140071189587520 ] WARNING: call
failed, retrying in 1 sec
[140071063762496] == Info:  CAfile: /etc/ssl/certs/ca-certificates.crt
[140071063762496] == Info:  CApath: none
2022-12-06 08:25:25.354103 [ Thread: 140071063762496 ] INFO: ssl_lock_cb
locking 0x5566a5dadb60
[140071063762496] == Info: SSL re-using session ID
2022-12-06 08:25:25.354163 [ Thread: 140071063762496 ] INFO:
ssl_unlock_cb released 0x5566a5dadb60
[140071063762496] == Info: TLSv1.0 (OUT), TLS header, Certificate Status
(22):
[140071063762496] 0000000005 bytes (0x00000005)
[140071063762496] 0000: 16 03 01 02 00                                 
.....
[140071063762496] == Info: TLSv1.3 (OUT), TLS handshake, Client hello (1):
[140071063762496] 0000000512 bytes (0x00000200)
[140071063762496] 0000: 01 00 01 fc 03 03 e9 df 6b b1 3d 74 36 3a 8b 3f
........k.=t6:.?

(multiple lines debug output removed)

[140071063762496] == Info: OpenSSL SSL_connect: Connection reset by peer
in connection to xxx.xxx.se:443
[140071063762496] == Info: Closing connection 0
2022-12-06 08:25:25.365715 [ Thread: 140071063762496 ] INFO: ssl_lock_cb
locking 0x5566a5dadb60
2022-12-06 08:25:25.365754 [ Thread: 140071063762496 ] INFO:
ssl_unlock_cb released 0x5566a5dadb60
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2022-12-06