Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL certificate problem #27

Closed
mattarnster opened this issue Dec 3, 2013 · 6 comments · Fixed by #29
Closed

SSL certificate problem #27

mattarnster opened this issue Dec 3, 2013 · 6 comments · Fixed by #29

Comments

@mattarnster
Copy link

Hi there, trying to use this with the Mashape API, and get this lovely exception when trying to make a request to an API endpoint:

Fatal error: Uncaught exception 'Exception' with message 'SSL certificate problem: self signed certificate in certificate chain' in C:*_\unirest\lib\Unirest\Unirest.php:166 Stack trace: #0 C:*_\unirest\lib\Unirest\Unirest.php(47): Unirest::request('GET', 'https://yoda.p....', NULL, Array, NULL, NULL) #1 C:*_\yoda.php(9): Unirest::get('https://yoda.p....', Array, NULL) #2 {main} thrown in C:*_**\unirest\lib\Unirest\Unirest.php on line 166

@subnetmarco
Copy link
Member

The library already supports SSL certificates, so it appears like it can't recognize the SSL certificate at the final host.

  • What URL are you trying to consume?
  • To isolate the problem, can you also make a test request to "https://www.mashape.com/" (which has a more widely recognized SSL cert, Verisign) and see if you get a successful response or you still get the same error?

@CyberKronos
Copy link

I am having the same problem as well. The test request on www.mashape.com works but when I use it in a script it gives that fatal error.

@subnetmarco
Copy link
Member

@CyberKronos To better understand the issue:

  1. If you make a GET request (without parameters) to "https://www.mashape.com", it works?
  2. Does it work if you make a GET request (without params) to "https://hello.p.mashape.com" ? The response should return a 403 status code, but we don't care. I'm just curious to check if any exception is thrown.

jasir pushed a commit to jasir/unirest-php that referenced this issue Dec 18, 2013
jasir added a commit to jasir/unirest-php that referenced this issue Dec 18, 2013
jasir added a commit to jasir/unirest-php that referenced this issue Dec 18, 2013
jasir added a commit to jasir/unirest-php that referenced this issue Dec 18, 2013
subnetmarco added a commit that referenced this issue Jan 6, 2014
Added possibility to switch off SSL verify peer option using Unirest::verifyPeer #27
@JefferyHus
Copy link

whom ever is facing this issue try this:

\Unirest\Request::verifyPeer(false);

@javase
Copy link

javase commented Oct 25, 2019

the version I use unirest is 3.1.02,
maven config is :
<dependency> <groupId>com.konghq</groupId> <artifactId>unirest-java</artifactId> <version>3.1.02</version> <classifier>standalone</classifier> </dependency>
and I see kong.unirest.UnirestException: javax.net.ssl.SSLHandshakeException
when I config "Unirest.config().verifySsl(false);" it works ,the exception disappear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants