How to consume an API that use a self signed SSL? - api

is there any one who can provide me with the way of consuming an API that use a self signed SSL in xamarin android.
An Exception thrown says:
Javax.Net.Ssl.HandshakeException:
'java.security.cert.CertPathValidatorException: Trust anchor for certification path not found'.
enter image description here

You can try to check whether SSL Certificate is correctly configured with the Certificate in your web.
We have to add the intermediate certificates in generating the .pem file.
You can go through this thread to install the intermediate certificate in your server:
Trust Anchor not found for Android SSL Connection
And there is a similar thread about this, you can check it here:Trust anchor for certification path not found [ Xamarin.Forms ] .

Related

Amazon Alexa Custom Skill using letsencrypt SSL Certificates

I am trying to publish my Alexa skill using Letsencrypt SSL Certificate.
Google Chrome does not show any warning icon if I browse to my https URL using letsencrypt certificate.
However, when I try to test using Alexa console, an error occurs as :
"SSL Handshake failed".
I see on Amazon Alexa forums that there is a buzz around letsencrypt support.
Some posts say it is supported and some say it isn't.
Could someone here clarify whether letsencrypt free SSL certificate is supported for building custom alexa skills ?
Download the contents of your fullchain.pem cert, from /etc/letsencrypt/live/<domain>/fullchain.pem on your server
On your skill config page, select the "SSL" Tab.
Mark "I will upload a self-signed certificate in X.509 format."
Paste the contents of your fullchain.pem file.
I was able to get a Let's Encrypt wildcard certificate working with an Alexa custom skill after choosing the option "My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority" in the developer console.
I also had an issue with a Nginx reverse proxy configuration that caused a failure in the Alexa Simulator and provided no helpful error. Fortunately you can also use the Manual JSON option which yielded the error "Cannot establish SSL connection to your skill endpoint".
I was able to track the issue down to the ssl_ciphers value in the ssl.conf file. Even though it was compatible with the Intermediate Security recommended setting for TLS 1.2, I had to comment it out to make it work. I hope someone else can determine why Amazon servers reject the certificate when this setting is used, it could be that TLS 1.3 is now required.

Unable to connect mule Anypoint Connectors Update Site

I'm trying to download object store.
I'm getting below error while connecting to Anypoint Connectors Update Site - https://repository.mulesoft.org/connectors/releases/3.5.0
Unable to read repository at https://repository.mulesoft.org/connectors/releases/3.5.0/content.xml.
Unable to read repository at https://repository.mulesoft.org/connectors/releases/3.5.0/content.xml.
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
It seems you are facing some ssl certificate issues, this usually occurs when your JVM truststore contains self-signed certificates (i.e. certificates not signed by a CA).
This case occurs when Java attempts to connect to another application over SSL (e.g.: HTTPS, IMAPS, LDAPS), it will only be able to connect to that application if it can trust it. The way trust is handled in the Java world is that you have a keystore (typically $JAVA_HOME/lib/security/cacerts), also known as the truststore. This contains a list of all known Certificate Authority (CA) certificates, and Java will only trust certificates that are signed by one of those CAs or public certificates that exist within that keystore.
But before jumping to conclusion do check Case 1 and 2
Case 1 : Check if the link is not blocked by your firewall
Do refer the Mulesoft Doc
Case 2 : Simply update your java (this is easy way)
Case 3 : Download Certificate manually and add in Java's truststore
Refer this link to know how to download certificate manually and this link to add the certificate to the truststore (you will need OpenSSL toolkit to transform the certificate to required format, it is described in the the mentioned link), and in case you are not familiar with different extension related to SSl certificate go check out this SO answer

IBM Worklight 5.0.6: Direct Update - SSLHandshakeException

My app connects to Worklight server through HTTPS through self-signed certificate. The app can be launched successfully.
However, when there is direct update which started downloading file from Worklight server, it is failed and I can see that there are error message regarding certification path not found.
May I know if the SSLHandshakeException and direct update error are correlated?
Thanks!
(Environment: Worklight 5.0.6.1, WAS ND 8.5, Testing Device: HTC One)
10-31 21:24:50.897: W/System.err(28746): Catch exception while startHandshake: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
10-31 21:24:50.897: W/System.err(28746): return an invalid session with invalid cipher suite of SSL_NULL_WITH_NULL_NULL
10-31 21:24:50.927: E/WLDroidGap(28746): Failed downloading application update file.
Yes, the use of direct update and the SSL handshake errors are related. Android doesn't allow you to work with self-signed certificates (unless you somehow bypass SSL). Because you can't install a self-signed cert into Android's truststore, the Android client can't establish trust for the server's self signed certificate.
You probably have the following flag specified in your Android manifest file:
android:debuggable="true"
This flag disables SSL validation when going thru the hybrid channels and probably the reason why you don't see the SSL errors earlier. Direct update is handled at a different level, where this flag does not apply, and therefore SSL validation does occur.
You should use self-signed CA certificates instead for dev/test purposes. See the following answer on how to generate a self-signed CA:
https://stackoverflow.com/a/19841469/2494287
Direct update will not work with a self-signed certificate. It is intended to be used in production, therefore it will only accept a valid CA cert.

Unable to load web app

Unable to load web application and console says the following
InstallationHandlers.isRegistered() failed, reason:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target
what does it means? Any Idea ?
Thanks,
Pramod
Check your SSL settings. Try to turn off SSL and see if it helps.
And, as error msg says, check all paths to keystores and all certificate aliases.
I don't use glassfish - I just look at error message. PKIX is format of file, that contains certificates. All certificates, depending of CA (certificate authority), belong to different paths. Example: certificate from Thawte belongs to Thawte certficiate paths, cert from Verisign belong to Verisign path. So there is something wrong with certificate you use: it does not belong to any registered path, I think. One of the most popular ways to use certificates is SSL, so I presume this is your case. SSL settings should be somewhere in glassfish - google it. Or, maybe, you can make your application use unencrypted connections.

how to a website SSL certificate is valid or not?

I got an issue from my client regarding the SSL setup for his website. I'm not familiar with the SSL certification setup process. He is saying that We have an SSL certificate for this server but I can’t tell if it’s setup properly or not.
If I open that website, firefox says Warning: Contains unauthorized content. I am seeing some details in the warning message window which are given below:
Web site: mydomain.com
Owner: This web site does not supply ownership information
Verified by: Not specified
Mainly I want to know whether the SSL certificate used for this site is valid or not. Can anybody suggest a way to check for the SSL certificate validation of a website.
Thanks
Telnet the server on port 443. If it is responding then it is a certificate problem
To install certificate
Check this