curl error 35 : unknown SSL protocol error in connection

后端 未结 8 1347
梦如初夏
梦如初夏 2021-02-08 12:08
$ curl -I https://9.185.173.135
curl: (35) Unknown SSL protocol error in connection to 9.185.173.135:443

This is an secured page that I need to access.

相关标签:
8条回答
  • 2021-02-08 12:32

    To Rudi : Thanks for the hint, that tells me a hell lot of info.

    Somehow the admin of the secured page "refreshes" the state of certifications every day. So although I got blocked from accessing it yesterday, it generously lets me to grab another certificate and add it to the exception list of Firefox.

    So everything is working, and I really learn something from yesterday's experience.

    0 讨论(0)
  • 2021-02-08 12:33

    I got the same error when running curl/httpie against a Tomcat server on my localhost deployed from Eclipse. It turns out that default server.xml deployed by Eclipse disables https. Specifically, the section below is commented out in server.xml.

    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    

    After uncommenting it out and adding the two keystore parameters, the curl command starts working (with --insecure option if the certificate is self-signed).

    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
               keystoreFile="/path/to/your/keystore"
               keystorePass="yourpass" />
    
    0 讨论(0)
  • 2021-02-08 12:34

    try this

    curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_SSLv3); // Force SSLv3 to fix Unknown SSL Protocol error
    
    0 讨论(0)
  • 2021-02-08 12:37

    i have some solutions that fix the issue for me:

    1] try update your curl/php/apache [ yum update ]

    2] restart apache

    Those worked for me!

    0 讨论(0)
  • 2021-02-08 12:43

    You can use --tlsv1 option to solve the issue in case the curl version is below 7.34

     curl -I --tlsv1 https://9.185.173.135
    
    0 讨论(0)
  • 2021-02-08 12:44

    I had the same error after updating my SSL certificate on the target SSL site. My source OS was Centos 6 and updating to a new curl version solved it. *Note I was already using the curl -k (insecure option) but I would still get that error. Essentially this error is caused by nss or openssl being out of date. yum -y install curl nss openssl Remember if you have a web application like PHP calling curl you will need to restart Apache to make the update take effect.

    I've updated based on this guide: http://realtechtalk.com/curl_35_Unknown_SSL_protocol_error_in_connection_Solution_Centos-1988-articles

    0 讨论(0)
提交回复
热议问题