Curl request is failing on the SSL?
I have this code
if(ereg("^(https)",$url))
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false);
// execute, and log the result to curl_put.log
$result = curl_exec($curl);
$error = curl_error($curl);
The error specified is
SSL read: error:00000000:lib(0):func(0):reason(0), errno 104
Any ideas on the cause
php curl libcurl
add a comment |
I have this code
if(ereg("^(https)",$url))
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false);
// execute, and log the result to curl_put.log
$result = curl_exec($curl);
$error = curl_error($curl);
The error specified is
SSL read: error:00000000:lib(0):func(0):reason(0), errno 104
Any ideas on the cause
php curl libcurl
1
is this not the same question? stackoverflow.com/questions/3875674/…
– Phill Pafford
Oct 6 '10 at 20:26
6
not even close...
– Matt Elhotiby
Oct 6 '10 at 20:28
1
Please note that disabling VERIFYPEER or VERIFYHOST makes the connection vulnerable to MITM attacks.
– Bruno
Nov 21 '14 at 11:22
add a comment |
I have this code
if(ereg("^(https)",$url))
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false);
// execute, and log the result to curl_put.log
$result = curl_exec($curl);
$error = curl_error($curl);
The error specified is
SSL read: error:00000000:lib(0):func(0):reason(0), errno 104
Any ideas on the cause
php curl libcurl
I have this code
if(ereg("^(https)",$url))
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false);
// execute, and log the result to curl_put.log
$result = curl_exec($curl);
$error = curl_error($curl);
The error specified is
SSL read: error:00000000:lib(0):func(0):reason(0), errno 104
Any ideas on the cause
php curl libcurl
php curl libcurl
edited Oct 6 '10 at 20:30
asked Oct 6 '10 at 20:24
Matt Elhotiby
16.8k68193298
16.8k68193298
1
is this not the same question? stackoverflow.com/questions/3875674/…
– Phill Pafford
Oct 6 '10 at 20:26
6
not even close...
– Matt Elhotiby
Oct 6 '10 at 20:28
1
Please note that disabling VERIFYPEER or VERIFYHOST makes the connection vulnerable to MITM attacks.
– Bruno
Nov 21 '14 at 11:22
add a comment |
1
is this not the same question? stackoverflow.com/questions/3875674/…
– Phill Pafford
Oct 6 '10 at 20:26
6
not even close...
– Matt Elhotiby
Oct 6 '10 at 20:28
1
Please note that disabling VERIFYPEER or VERIFYHOST makes the connection vulnerable to MITM attacks.
– Bruno
Nov 21 '14 at 11:22
1
1
is this not the same question? stackoverflow.com/questions/3875674/…
– Phill Pafford
Oct 6 '10 at 20:26
is this not the same question? stackoverflow.com/questions/3875674/…
– Phill Pafford
Oct 6 '10 at 20:26
6
6
not even close...
– Matt Elhotiby
Oct 6 '10 at 20:28
not even close...
– Matt Elhotiby
Oct 6 '10 at 20:28
1
1
Please note that disabling VERIFYPEER or VERIFYHOST makes the connection vulnerable to MITM attacks.
– Bruno
Nov 21 '14 at 11:22
Please note that disabling VERIFYPEER or VERIFYHOST makes the connection vulnerable to MITM attacks.
– Bruno
Nov 21 '14 at 11:22
add a comment |
6 Answers
6
active
oldest
votes
With SSL, make sure that you have openssl extension turned on from php.ini.
How do I turn that on?
– Jake Sylvestre
Feb 24 '16 at 0:32
in the PHP.ini file if you are using WAMPP or XAMPP , but still, after enabling it, i am having the same error code
– Zame
Aug 9 '16 at 12:59
add a comment |
I encountered a similar cryptic error while working with a third-party library. I tried the CURLOPT_SSL_VERIFY[PEER|HOST] but it made no difference. My error message was similar:
SSL read: error:00000000:lib(0):func(0):reason(0), errno 54
So I visited http://curl.haxx.se/libcurl/c/libcurl-errors.html, looking for the error code 54.
CURLE_SSL_ENGINE_SETFAILED (54) Failed setting the selected SSL crypto engine as default!
This was wrong though - I was making other HTTPS requests using curl in other parts of the application. So I kept digging and found this question, R & RCurl: Error 54 in libcurl, which had this gem:
The output you see is from lib/ssluse.c in libcurl's source code and the "errno" mentioned there is not the libcurl error code but the actual errno variable at that time.
So, don't let the output of curl_error() mislead you. Instead, use curl_errno() to obtain the correct error code, which in this case was actually 56, CURLE_RECV_ERROR. Had the wrong host name...
I got errno 104, instead it was also really 56, thanks!
– Graftak
Mar 2 '17 at 13:42
add a comment |
I've had the same problem. It turned out, that the ssl on the target system had a bad configuration.
After checking the php curl module, the GuzzleHttp version, the openssl version I called the link in the browser and it worked. But with curl --tlsv1 -kv https://www.example.com on the console there was still an error.
So I checked the ssl configuration at https://www.ssllabs.com/ssltest/ It was rated with B. And there where some Online Certificate Status Protocol (OCSP) errors I haven't seen before. Finally I changed my configuration on the target system to the suggestions at https://cipherli.st/ restarted the webserver and everything worked. The new rating at ssllabs is now A+.
My nginx configuration (Ubuntu 14.04, nginx 1.4.6-1ubuntu3.5):
ssl on;
ssl_certificate /etc/ssl/certs/1_www.example.com_bundle.crt;
ssl_certificate_key /etc/ssl/private/www.example.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
ssl_session_cache shared:SSL:10m;
#ssl_session_tickets off; # Requires nginx >= 1.5.9
ssl_stapling on; # Requires nginx >= 1.3.7
ssl_stapling_verify off; # Requires nginx => 1.3.7
ssl_dhparam /etc/ssl/private/dhparams.pem;
ssl_trusted_certificate /etc/ssl/startssl.ca.pem;
resolver 8.8.8.8 valid=300s;
resolver_timeout 5s;
add_header Strict-Transport-Security "max-age=63072000; www.example.com; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
In my case I also needed to limit thessl_protocolstoTLSv1.2as v1 and v1.1 conflicted with the rest of my environment.
– shawncampbell
Jul 12 '18 at 23:34
add a comment |
add this:
curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, 0);
I had the same error and worked fine for me.
4
why use HTTPS at all if verify is off?
– Marius Balčytis
Feb 21 '14 at 8:36
5
if you trust the channel, you can disregard the flag verify host, the encryption works, but you dont need to check the cert
– jipipayo
Feb 21 '14 at 9:18
1
This just makes the connection vulnerable to MITM attacks (see this).
– Bruno
Nov 21 '14 at 11:21
no if you are using this curl to get data from your own network, read unencrypted data do not implies attack, sometimes you dont need to encrypt this data.
– jipipayo
Feb 5 '15 at 15:01
add a comment |
I had the same error printed by the function curl_error but this is not necessarily related to SSL. It is better to print the precise error number with the function curl_errno and you can diagnose better from there. In my case it returned me a 52 error code and I could debug from there, in fact the other server was not sending any data.
add a comment |
I think you mean to use CURLOPT_SSL_VERIFYHOST, not CURLOPT_SSL_VERIFYPEER
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f3876563%2fcurl-request-is-failing-on-the-ssl%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
With SSL, make sure that you have openssl extension turned on from php.ini.
How do I turn that on?
– Jake Sylvestre
Feb 24 '16 at 0:32
in the PHP.ini file if you are using WAMPP or XAMPP , but still, after enabling it, i am having the same error code
– Zame
Aug 9 '16 at 12:59
add a comment |
With SSL, make sure that you have openssl extension turned on from php.ini.
How do I turn that on?
– Jake Sylvestre
Feb 24 '16 at 0:32
in the PHP.ini file if you are using WAMPP or XAMPP , but still, after enabling it, i am having the same error code
– Zame
Aug 9 '16 at 12:59
add a comment |
With SSL, make sure that you have openssl extension turned on from php.ini.
With SSL, make sure that you have openssl extension turned on from php.ini.
edited Oct 6 '10 at 20:32
answered Oct 6 '10 at 20:26
Sarfraz
298k62467546
298k62467546
How do I turn that on?
– Jake Sylvestre
Feb 24 '16 at 0:32
in the PHP.ini file if you are using WAMPP or XAMPP , but still, after enabling it, i am having the same error code
– Zame
Aug 9 '16 at 12:59
add a comment |
How do I turn that on?
– Jake Sylvestre
Feb 24 '16 at 0:32
in the PHP.ini file if you are using WAMPP or XAMPP , but still, after enabling it, i am having the same error code
– Zame
Aug 9 '16 at 12:59
How do I turn that on?
– Jake Sylvestre
Feb 24 '16 at 0:32
How do I turn that on?
– Jake Sylvestre
Feb 24 '16 at 0:32
in the PHP.ini file if you are using WAMPP or XAMPP , but still, after enabling it, i am having the same error code
– Zame
Aug 9 '16 at 12:59
in the PHP.ini file if you are using WAMPP or XAMPP , but still, after enabling it, i am having the same error code
– Zame
Aug 9 '16 at 12:59
add a comment |
I encountered a similar cryptic error while working with a third-party library. I tried the CURLOPT_SSL_VERIFY[PEER|HOST] but it made no difference. My error message was similar:
SSL read: error:00000000:lib(0):func(0):reason(0), errno 54
So I visited http://curl.haxx.se/libcurl/c/libcurl-errors.html, looking for the error code 54.
CURLE_SSL_ENGINE_SETFAILED (54) Failed setting the selected SSL crypto engine as default!
This was wrong though - I was making other HTTPS requests using curl in other parts of the application. So I kept digging and found this question, R & RCurl: Error 54 in libcurl, which had this gem:
The output you see is from lib/ssluse.c in libcurl's source code and the "errno" mentioned there is not the libcurl error code but the actual errno variable at that time.
So, don't let the output of curl_error() mislead you. Instead, use curl_errno() to obtain the correct error code, which in this case was actually 56, CURLE_RECV_ERROR. Had the wrong host name...
I got errno 104, instead it was also really 56, thanks!
– Graftak
Mar 2 '17 at 13:42
add a comment |
I encountered a similar cryptic error while working with a third-party library. I tried the CURLOPT_SSL_VERIFY[PEER|HOST] but it made no difference. My error message was similar:
SSL read: error:00000000:lib(0):func(0):reason(0), errno 54
So I visited http://curl.haxx.se/libcurl/c/libcurl-errors.html, looking for the error code 54.
CURLE_SSL_ENGINE_SETFAILED (54) Failed setting the selected SSL crypto engine as default!
This was wrong though - I was making other HTTPS requests using curl in other parts of the application. So I kept digging and found this question, R & RCurl: Error 54 in libcurl, which had this gem:
The output you see is from lib/ssluse.c in libcurl's source code and the "errno" mentioned there is not the libcurl error code but the actual errno variable at that time.
So, don't let the output of curl_error() mislead you. Instead, use curl_errno() to obtain the correct error code, which in this case was actually 56, CURLE_RECV_ERROR. Had the wrong host name...
I got errno 104, instead it was also really 56, thanks!
– Graftak
Mar 2 '17 at 13:42
add a comment |
I encountered a similar cryptic error while working with a third-party library. I tried the CURLOPT_SSL_VERIFY[PEER|HOST] but it made no difference. My error message was similar:
SSL read: error:00000000:lib(0):func(0):reason(0), errno 54
So I visited http://curl.haxx.se/libcurl/c/libcurl-errors.html, looking for the error code 54.
CURLE_SSL_ENGINE_SETFAILED (54) Failed setting the selected SSL crypto engine as default!
This was wrong though - I was making other HTTPS requests using curl in other parts of the application. So I kept digging and found this question, R & RCurl: Error 54 in libcurl, which had this gem:
The output you see is from lib/ssluse.c in libcurl's source code and the "errno" mentioned there is not the libcurl error code but the actual errno variable at that time.
So, don't let the output of curl_error() mislead you. Instead, use curl_errno() to obtain the correct error code, which in this case was actually 56, CURLE_RECV_ERROR. Had the wrong host name...
I encountered a similar cryptic error while working with a third-party library. I tried the CURLOPT_SSL_VERIFY[PEER|HOST] but it made no difference. My error message was similar:
SSL read: error:00000000:lib(0):func(0):reason(0), errno 54
So I visited http://curl.haxx.se/libcurl/c/libcurl-errors.html, looking for the error code 54.
CURLE_SSL_ENGINE_SETFAILED (54) Failed setting the selected SSL crypto engine as default!
This was wrong though - I was making other HTTPS requests using curl in other parts of the application. So I kept digging and found this question, R & RCurl: Error 54 in libcurl, which had this gem:
The output you see is from lib/ssluse.c in libcurl's source code and the "errno" mentioned there is not the libcurl error code but the actual errno variable at that time.
So, don't let the output of curl_error() mislead you. Instead, use curl_errno() to obtain the correct error code, which in this case was actually 56, CURLE_RECV_ERROR. Had the wrong host name...
edited May 23 '17 at 12:26
Community♦
11
11
answered Jul 4 '13 at 6:14
Nick Caballero
8651818
8651818
I got errno 104, instead it was also really 56, thanks!
– Graftak
Mar 2 '17 at 13:42
add a comment |
I got errno 104, instead it was also really 56, thanks!
– Graftak
Mar 2 '17 at 13:42
I got errno 104, instead it was also really 56, thanks!
– Graftak
Mar 2 '17 at 13:42
I got errno 104, instead it was also really 56, thanks!
– Graftak
Mar 2 '17 at 13:42
add a comment |
I've had the same problem. It turned out, that the ssl on the target system had a bad configuration.
After checking the php curl module, the GuzzleHttp version, the openssl version I called the link in the browser and it worked. But with curl --tlsv1 -kv https://www.example.com on the console there was still an error.
So I checked the ssl configuration at https://www.ssllabs.com/ssltest/ It was rated with B. And there where some Online Certificate Status Protocol (OCSP) errors I haven't seen before. Finally I changed my configuration on the target system to the suggestions at https://cipherli.st/ restarted the webserver and everything worked. The new rating at ssllabs is now A+.
My nginx configuration (Ubuntu 14.04, nginx 1.4.6-1ubuntu3.5):
ssl on;
ssl_certificate /etc/ssl/certs/1_www.example.com_bundle.crt;
ssl_certificate_key /etc/ssl/private/www.example.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
ssl_session_cache shared:SSL:10m;
#ssl_session_tickets off; # Requires nginx >= 1.5.9
ssl_stapling on; # Requires nginx >= 1.3.7
ssl_stapling_verify off; # Requires nginx => 1.3.7
ssl_dhparam /etc/ssl/private/dhparams.pem;
ssl_trusted_certificate /etc/ssl/startssl.ca.pem;
resolver 8.8.8.8 valid=300s;
resolver_timeout 5s;
add_header Strict-Transport-Security "max-age=63072000; www.example.com; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
In my case I also needed to limit thessl_protocolstoTLSv1.2as v1 and v1.1 conflicted with the rest of my environment.
– shawncampbell
Jul 12 '18 at 23:34
add a comment |
I've had the same problem. It turned out, that the ssl on the target system had a bad configuration.
After checking the php curl module, the GuzzleHttp version, the openssl version I called the link in the browser and it worked. But with curl --tlsv1 -kv https://www.example.com on the console there was still an error.
So I checked the ssl configuration at https://www.ssllabs.com/ssltest/ It was rated with B. And there where some Online Certificate Status Protocol (OCSP) errors I haven't seen before. Finally I changed my configuration on the target system to the suggestions at https://cipherli.st/ restarted the webserver and everything worked. The new rating at ssllabs is now A+.
My nginx configuration (Ubuntu 14.04, nginx 1.4.6-1ubuntu3.5):
ssl on;
ssl_certificate /etc/ssl/certs/1_www.example.com_bundle.crt;
ssl_certificate_key /etc/ssl/private/www.example.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
ssl_session_cache shared:SSL:10m;
#ssl_session_tickets off; # Requires nginx >= 1.5.9
ssl_stapling on; # Requires nginx >= 1.3.7
ssl_stapling_verify off; # Requires nginx => 1.3.7
ssl_dhparam /etc/ssl/private/dhparams.pem;
ssl_trusted_certificate /etc/ssl/startssl.ca.pem;
resolver 8.8.8.8 valid=300s;
resolver_timeout 5s;
add_header Strict-Transport-Security "max-age=63072000; www.example.com; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
In my case I also needed to limit thessl_protocolstoTLSv1.2as v1 and v1.1 conflicted with the rest of my environment.
– shawncampbell
Jul 12 '18 at 23:34
add a comment |
I've had the same problem. It turned out, that the ssl on the target system had a bad configuration.
After checking the php curl module, the GuzzleHttp version, the openssl version I called the link in the browser and it worked. But with curl --tlsv1 -kv https://www.example.com on the console there was still an error.
So I checked the ssl configuration at https://www.ssllabs.com/ssltest/ It was rated with B. And there where some Online Certificate Status Protocol (OCSP) errors I haven't seen before. Finally I changed my configuration on the target system to the suggestions at https://cipherli.st/ restarted the webserver and everything worked. The new rating at ssllabs is now A+.
My nginx configuration (Ubuntu 14.04, nginx 1.4.6-1ubuntu3.5):
ssl on;
ssl_certificate /etc/ssl/certs/1_www.example.com_bundle.crt;
ssl_certificate_key /etc/ssl/private/www.example.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
ssl_session_cache shared:SSL:10m;
#ssl_session_tickets off; # Requires nginx >= 1.5.9
ssl_stapling on; # Requires nginx >= 1.3.7
ssl_stapling_verify off; # Requires nginx => 1.3.7
ssl_dhparam /etc/ssl/private/dhparams.pem;
ssl_trusted_certificate /etc/ssl/startssl.ca.pem;
resolver 8.8.8.8 valid=300s;
resolver_timeout 5s;
add_header Strict-Transport-Security "max-age=63072000; www.example.com; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
I've had the same problem. It turned out, that the ssl on the target system had a bad configuration.
After checking the php curl module, the GuzzleHttp version, the openssl version I called the link in the browser and it worked. But with curl --tlsv1 -kv https://www.example.com on the console there was still an error.
So I checked the ssl configuration at https://www.ssllabs.com/ssltest/ It was rated with B. And there where some Online Certificate Status Protocol (OCSP) errors I haven't seen before. Finally I changed my configuration on the target system to the suggestions at https://cipherli.st/ restarted the webserver and everything worked. The new rating at ssllabs is now A+.
My nginx configuration (Ubuntu 14.04, nginx 1.4.6-1ubuntu3.5):
ssl on;
ssl_certificate /etc/ssl/certs/1_www.example.com_bundle.crt;
ssl_certificate_key /etc/ssl/private/www.example.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
ssl_session_cache shared:SSL:10m;
#ssl_session_tickets off; # Requires nginx >= 1.5.9
ssl_stapling on; # Requires nginx >= 1.3.7
ssl_stapling_verify off; # Requires nginx => 1.3.7
ssl_dhparam /etc/ssl/private/dhparams.pem;
ssl_trusted_certificate /etc/ssl/startssl.ca.pem;
resolver 8.8.8.8 valid=300s;
resolver_timeout 5s;
add_header Strict-Transport-Security "max-age=63072000; www.example.com; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
answered Sep 23 '16 at 14:58
Markus D.
864
864
In my case I also needed to limit thessl_protocolstoTLSv1.2as v1 and v1.1 conflicted with the rest of my environment.
– shawncampbell
Jul 12 '18 at 23:34
add a comment |
In my case I also needed to limit thessl_protocolstoTLSv1.2as v1 and v1.1 conflicted with the rest of my environment.
– shawncampbell
Jul 12 '18 at 23:34
In my case I also needed to limit the
ssl_protocols to TLSv1.2 as v1 and v1.1 conflicted with the rest of my environment.– shawncampbell
Jul 12 '18 at 23:34
In my case I also needed to limit the
ssl_protocols to TLSv1.2 as v1 and v1.1 conflicted with the rest of my environment.– shawncampbell
Jul 12 '18 at 23:34
add a comment |
add this:
curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, 0);
I had the same error and worked fine for me.
4
why use HTTPS at all if verify is off?
– Marius Balčytis
Feb 21 '14 at 8:36
5
if you trust the channel, you can disregard the flag verify host, the encryption works, but you dont need to check the cert
– jipipayo
Feb 21 '14 at 9:18
1
This just makes the connection vulnerable to MITM attacks (see this).
– Bruno
Nov 21 '14 at 11:21
no if you are using this curl to get data from your own network, read unencrypted data do not implies attack, sometimes you dont need to encrypt this data.
– jipipayo
Feb 5 '15 at 15:01
add a comment |
add this:
curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, 0);
I had the same error and worked fine for me.
4
why use HTTPS at all if verify is off?
– Marius Balčytis
Feb 21 '14 at 8:36
5
if you trust the channel, you can disregard the flag verify host, the encryption works, but you dont need to check the cert
– jipipayo
Feb 21 '14 at 9:18
1
This just makes the connection vulnerable to MITM attacks (see this).
– Bruno
Nov 21 '14 at 11:21
no if you are using this curl to get data from your own network, read unencrypted data do not implies attack, sometimes you dont need to encrypt this data.
– jipipayo
Feb 5 '15 at 15:01
add a comment |
add this:
curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, 0);
I had the same error and worked fine for me.
add this:
curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, 0);
I had the same error and worked fine for me.
edited Jan 31 '12 at 3:08
wim
158k50300430
158k50300430
answered Nov 4 '11 at 20:53
jipipayo
2,42512734
2,42512734
4
why use HTTPS at all if verify is off?
– Marius Balčytis
Feb 21 '14 at 8:36
5
if you trust the channel, you can disregard the flag verify host, the encryption works, but you dont need to check the cert
– jipipayo
Feb 21 '14 at 9:18
1
This just makes the connection vulnerable to MITM attacks (see this).
– Bruno
Nov 21 '14 at 11:21
no if you are using this curl to get data from your own network, read unencrypted data do not implies attack, sometimes you dont need to encrypt this data.
– jipipayo
Feb 5 '15 at 15:01
add a comment |
4
why use HTTPS at all if verify is off?
– Marius Balčytis
Feb 21 '14 at 8:36
5
if you trust the channel, you can disregard the flag verify host, the encryption works, but you dont need to check the cert
– jipipayo
Feb 21 '14 at 9:18
1
This just makes the connection vulnerable to MITM attacks (see this).
– Bruno
Nov 21 '14 at 11:21
no if you are using this curl to get data from your own network, read unencrypted data do not implies attack, sometimes you dont need to encrypt this data.
– jipipayo
Feb 5 '15 at 15:01
4
4
why use HTTPS at all if verify is off?
– Marius Balčytis
Feb 21 '14 at 8:36
why use HTTPS at all if verify is off?
– Marius Balčytis
Feb 21 '14 at 8:36
5
5
if you trust the channel, you can disregard the flag verify host, the encryption works, but you dont need to check the cert
– jipipayo
Feb 21 '14 at 9:18
if you trust the channel, you can disregard the flag verify host, the encryption works, but you dont need to check the cert
– jipipayo
Feb 21 '14 at 9:18
1
1
This just makes the connection vulnerable to MITM attacks (see this).
– Bruno
Nov 21 '14 at 11:21
This just makes the connection vulnerable to MITM attacks (see this).
– Bruno
Nov 21 '14 at 11:21
no if you are using this curl to get data from your own network, read unencrypted data do not implies attack, sometimes you dont need to encrypt this data.
– jipipayo
Feb 5 '15 at 15:01
no if you are using this curl to get data from your own network, read unencrypted data do not implies attack, sometimes you dont need to encrypt this data.
– jipipayo
Feb 5 '15 at 15:01
add a comment |
I had the same error printed by the function curl_error but this is not necessarily related to SSL. It is better to print the precise error number with the function curl_errno and you can diagnose better from there. In my case it returned me a 52 error code and I could debug from there, in fact the other server was not sending any data.
add a comment |
I had the same error printed by the function curl_error but this is not necessarily related to SSL. It is better to print the precise error number with the function curl_errno and you can diagnose better from there. In my case it returned me a 52 error code and I could debug from there, in fact the other server was not sending any data.
add a comment |
I had the same error printed by the function curl_error but this is not necessarily related to SSL. It is better to print the precise error number with the function curl_errno and you can diagnose better from there. In my case it returned me a 52 error code and I could debug from there, in fact the other server was not sending any data.
I had the same error printed by the function curl_error but this is not necessarily related to SSL. It is better to print the precise error number with the function curl_errno and you can diagnose better from there. In my case it returned me a 52 error code and I could debug from there, in fact the other server was not sending any data.
answered Aug 9 '13 at 9:56
eloone
2,86112131
2,86112131
add a comment |
add a comment |
I think you mean to use CURLOPT_SSL_VERIFYHOST, not CURLOPT_SSL_VERIFYPEER
add a comment |
I think you mean to use CURLOPT_SSL_VERIFYHOST, not CURLOPT_SSL_VERIFYPEER
add a comment |
I think you mean to use CURLOPT_SSL_VERIFYHOST, not CURLOPT_SSL_VERIFYPEER
I think you mean to use CURLOPT_SSL_VERIFYHOST, not CURLOPT_SSL_VERIFYPEER
answered Oct 7 '10 at 1:02
Eli
4,7452126
4,7452126
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f3876563%2fcurl-request-is-failing-on-the-ssl%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
is this not the same question? stackoverflow.com/questions/3875674/…
– Phill Pafford
Oct 6 '10 at 20:26
6
not even close...
– Matt Elhotiby
Oct 6 '10 at 20:28
1
Please note that disabling VERIFYPEER or VERIFYHOST makes the connection vulnerable to MITM attacks.
– Bruno
Nov 21 '14 at 11:22