TLS 1.2 not working in cURL

后端 未结 5 1284
有刺的猬
有刺的猬 2020-11-27 17:28

I am having trouble curling an HTTPS url that uses TLS1.2, in my curl operation I post my login data into the website and save it in cookiefile. The error message I am getti

5条回答
  •  -上瘾入骨i
    2020-11-27 17:54

    You must use an integer value for the CURLOPT_SSLVERSION value, not a string as listed above

    Try this:

    curl_setopt ($setuploginurl, CURLOPT_SSLVERSION, 6); //Integer NOT string TLS v1.2
    

    http://php.net/manual/en/function.curl-setopt.php

    value should be an integer for the following values of the option parameter: CURLOPT_SSLVERSION

    One of

    CURL_SSLVERSION_DEFAULT (0)
    CURL_SSLVERSION_TLSv1 (1)
    CURL_SSLVERSION_SSLv2 (2)
    CURL_SSLVERSION_SSLv3 (3)
    CURL_SSLVERSION_TLSv1_0 (4)
    CURL_SSLVERSION_TLSv1_1 (5)
    CURL_SSLVERSION_TLSv1_2 (6).

提交回复
热议问题