Allow https connection - java

I am trying to connect to a web server using https but I am having Trust anchor for certification path not found. I don't have the certificate of the web server but I want my application to allow connection to the server. However, I am only finding solutions about trusting all https connection. I only want to trust a certain web server. What approach do I have to do to achieve this?

If you use https without a certificate it is useless. The certificate ensures that the connection is not manipulated by a hacker. So you should get a certificate or use http.

Related

Is it possible to disable ssl for https?

Application on java. OkHttp version 2.7.5 is used. A request is made to another service and an error occurs.
SSLHandshakeException: sun.security.validator.ValidatorException:
PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
I do not have a certificate. It seems there are solutions for the version of okHttp3. But the version can not be changed. How to solve a problem?
Is it possible to disable ssl for https?
Literally, no.
Use of SSL is fundamental to the HTTPS protocol. If you don't want to use SSL at all, configure your server with an HTTP endpoint and use that instead of HTTPS.
Furthermore use of SSL requires a certificate that is (at least) syntactically well-formed. That is also fundamental to the HTTPS protocol.
Now if the problem is that your server certificate has expired, then a possible solution is to use the approach described in:
Make a connection to a HTTPS server from Java and ignore the validity of the security certificate.
And if the problem is that you cannot get a proper certificate for the server (e.g. you can't afford it) then an alternative solution is:
generate a self-signed certificate; see How to generate a self-signed certificate using Java Keytool,
install it on the server side,
configure the client as above to ignore certificate validity.
But note that doing either of those things has security issues.
There is a third solution that is more secure.
generate a self-signed certificate (as above)
install it on the server side,
use Keytool to add the certificate to the client app's keystore as a trusted certificate.

How to generate SSL certificate on subdomain?

I actually have a hosting service who has a subdomain, that subdomain function is to redirect to my local server where I have my services, for example:
My domain: example.com
Subdomain: guaymas.example.com // His function is to redirect to my server (firewall)
Redirect to a port : guaymas.example.com:8080 // where I have my services
And through a port I have a web service, in order to make the data transfer more secure I wanted to implement a SSL certificate but because of my configuration I’ḿ not able to generate the certificate with letś encrypt (because buying one is not an option), I can’t verify with http or dns method, Is there any other method that I can use to generate the SSL certificate?
PD: I'm using GlassFish and Soap web services on JAVA, those are running on Linux Server and my distro is deepin
Thanks a lot

Reach HTTPS url using wildcard SSL certificate

My web application is trying to reach the WSDL deployed at another server with the URL: https://172.xx.xx.xxx/interface/Webservice?WSDL
In order to do this, I've installed their SSL certificate to the keystore of my application server. However, the SSL certificate of the server I'm connecting to uses a wildcard SSL certificate.
Thus I'm getting the error: HTTPS hostname wrong: should be <172.xx.xx.xxx>
The server I'm connecting to doesn't have any plans to add my desired SAN in their certificates. Is there another way to connect to a wildcard SSL certificate?

Why i m getting "Not secure" in front of website name in the url?

I have issue with website url.When I enter website url in the chrome,then websites name comes with
Not secure| www.mywebsitesname.com
How can I change this to
Secure |http://mywebsitesname.com
Is it possible?
Yes, it is possible make your website secure. You need to buy a SSL certificate for that and set all internal url to run on HTTPS instead of HTTP. Because HTTP is not secure.
You can buy SSL certificate from Godaddy
After that your site will have something like this before url
For more on HTTP VS HTTPS please read this
Change your url HTTP to HTTPS by SSL certification
HTTP VS HTTPS
Hyper Text Transfer Protocol Secure (HTTPS) is the secure version of HTTP, the protocol over which data is sent between your browser and the website that you are connected to. The 'S' at the end of HTTPS stands for 'Secure'. It means all communications between your browser and the website are encrypted.
From begin of 2017 more (especially e-commerce) site that don't have the
https
are signed with 'non sicure'. To solve this problem you can implements on your site the https module simpy to buy a SSL from your provider.

OkHttp SSL Certificate

So i am developing an app which uses a rest connection to a database server. This server uses TLS encryption and has a SSL certificate. Im using OkHttp3.2 to manage my server connection. I can connect to the server without any problems and also encryption works fine.
My question is based on the certificate tester from java's SSL Engine. I can readout everything the Server send about the certificate (Serial, Signature...) but i cant see any information about validation or trust level like a certificate chain.
Does the SSL Engine tests the Certificate independently or do i have to do this manually?
And would OkHttp's certificate pinning do the Job?
And how would i readout the SHA checksum of the certificate like some ssl tester do? e.g. ssllabs.com
So Thanks to Pravin's comment i think i know everything i need.
If someone is intrested a little conclusion of the article:
Android's SSL Engine checkes validity of the Certificate at every Request. The Certificate is compared with trustet root certificates in local system storage (Settings -> Security -> Trusted credentials).
Certificate pinning would add a second security level, in fact it checkes if a certificate in the certificate-chain has a fringerprint which is equal to your setting. Usefull if you would only want to allow a certifiace of a specified provider to communicade with your app.

Categories