Forum Discussion

suganeby's avatar
suganeby
New Contributor
9 years ago

Ready API 1.6.0, javax.net.ssl.SSLHandshakeException "Received fatal alert: bad_certificate"

In Ready API 1.6.0, In the test step "Publish using MQTT", i get the below error message

 

"Error during message publishing: org.eclipse.paho.client.mqttv3.MqttException "MqttException"; cause: javax.net.ssl.SSLHandshakeException "Received fatal alert: bad_certificate""

 

I created a key store(keystore.jks) using the keytool and added the keystore in the preferrences. I am trying to eveluate the tool for our project.  if this doesnt work then we might need to look for other options.

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Suganeby,

     

    Try the following:
    1) open a http session to the server and download the certificate (eg cer - file) 
    2) switch to the jre\lib\security - path of soapui, make a backup of cacerts. 
    3) Import the cer-File to the cacerts-File like this: 
    keytool -import -alias <alias> -file <cer> -keystore cacerts -storepass changeit
    where <alias> is the hostname (google.com) and 
    <cer> is the filepath to the cer-file. 

    • suganeby's avatar
      suganeby
      New Contributor

      Hi Tanya,

       

      Thanks for getting back.

      1. I downloaded the cert files from the server. Cert files downloaded from the server includes (privatekey.pem and certificate.pem). Another file ca.crt from "https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem"

       

      2. Used the below command to generate p12 keystore file

      "openssl pkcs12 -export -out certificate.p12 -inkey privatekey.pem -in certificate.pem -certfile ca.crt"

       

      3. After step 1 and step 2, i tried your suggestion as below

      keytool -import -alias <hostname> -file <path to the certificate.p12 file generated in step 2> -keystore cacerts -storepass changeit

      it throws error "keytool error: java.lang.Exception: Input not an X.509 certificate"