-
Notifications
You must be signed in to change notification settings - Fork 594
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
Disable SSL Certificate check #70
Comments
I achieved self-signed certificate trusting with the following code: SSLContext sslcontext = SSLContexts.custom()
.loadTrustMaterial(null, new TrustSelfSignedStrategy())
.build();
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext);
CloseableHttpClient httpclient = HttpClients.custom()
.setSSLSocketFactory(sslsf)
.build();
Unirest.setHttpClient(httpclient); However, the requests are incredibly slow (~10 seconds with custom HttpClient and Unirest, on the localhost) compared to a regular REST client (~0.14 second with CocoaRestClient, on the localhost). You might imagine that with such a speed, Unirest becomes unusable. |
The issue seems to be resolved when a bunch of packages were updated. I don't know what caused the issue. |
I'm also having trouble with this issue. It would be nice to be able to ignore SSL certificate checks in Java. |
@monarchjhaveri I'm so sorry, I really don't remember :( Maybe it was a Java update that seemingly resolved this speed issue. Are you having that speed issue as well? |
Hi @aemreunal , thanks for replying, I managed to resolve that speed issue :-) it was a problem with my code |
How to set X509Certificate in unirest request. |
import java.security.cert.X509Certificate;
|
@boodskap It's worked well, thanks. |
…t how to test network requests with node identity verification. This is requiring some mocking of DigitalSignature class using PowerMock Using the right versions of some libraries, otherwise Unirest breaks Unirest client does not seem to work properly anymore. This might be due to some updates. These thread over here might have the answer to such problems: Kong/unirest-java#70 But it must be investigated further. Additionally, I added a boolean variable in the settings to enable/disable node pinging
Im still getting |
@Jofairden , it may be you don't set proxy. and I found you must set the proxy through httpclient instead of unirest. which like: It works for me! |
@wanghuanjing Works for me too, poor chinese~ |
This is actually built into Unirest now with |
thank you so much , it works |
Thank you it works for me! |
Thanks it work for me also. |
Excelent!! Thank you very much!! |
Just don't do that prod please |
Hello,
I'm writing a server on Spring and I'm using Spring Security to limit connections to HTTPS, running the WAR on Tomcat. The server auto-generates a self-signed certificate and as I am using it in a development environment, I don't want to go through the hassle of obtaining proper certificates or something. This means that Unirest (or rather the underlying HTTP client) rejects the certificate with the following exception:
It's a pretty frustrating situation to be in, as I genuinely believe many people are using Unirest with these certificates. I think I can circumvent this issue by creating a custom HttpClient object and giving it to Unirest as the default, but I'd rather not mess with Unirest, in order to avoid any future issues down the line.
I've noticed that the PHP version got this option (Kong/unirest-php#27) quite some time ago.
My questions are:
Thanks in advance for your time.
The text was updated successfully, but these errors were encountered: