<div dir="ltr">Hi ,<div><div>we are trying to add tls support to socks proxy with Curl as part of that we are trying to complete initial TLS handshake.</div><div>we are trying to run openssl s_server on loopback interface to verify changes<br></div><div>we tried two methods both are resulting in fatal error alert from server.<br></div><div><br></div><div>Method 1 - use existing api's used for http proxy but remove any conditions specific for HTTPS proxy.(wireshark: lo_sslversion.pcap)</div></div><ul><ul><li>SSL upgrade of existing socket using curl API’s curl_ssl_connect_nonblocking and curl_ssl_init_proxy for TLS handshake</li><li>Fatal alert: protocol version</li></ul></ul><div>Method 2- use new SSL context init and add certificates/key manually, do simple ssl_connect on sockfd (wireshark: inverse_server_client_l0.pcap)</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote><ul><ul><li>SSL_set_fd(ssl, sockfd) and SSL_connect(ssl) are used.</li><li>Fatal alert illegal parameter.</li></ul></ul><div><div><div>Commands used:</div><div>server: openssl s_server --accept 1080 -cert certificate1.pem -key key1.pem<br></div><div>client: curl -v -g -k --proxy socks5://<a href="http://127.0.0.1:1080/" target="_blank">127.0.0.1:1080</a>  <a href="https://www.google.com/" target="_blank">https://www.google.com</a></div></div><div><br></div><div>could you please help understand this error?</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">thanks,<div><br><div>Anand.S</div></div></div></div></div></div>