Forum Discussion

Dhanya_shree's avatar
Dhanya_shree
Occasional Visitor
5 years ago

SSL Certificate error while trying to import swagger definition

I am trying to create a API project by using swagger/Open API definition(Rest) option.
I have provided the a correct swagger definition(HTTPS) , but while importing it is throwing an error as 
"unable to read location '<swagger.json>' due to a SSL configuration error. It is possible that the server SSL certificate is invalid, self-signed, or has an untrusted Certificate Authority."
From ready api documentation is saw that we face this issue when the specification is https and followed this solution,

but even after doing this i am facing the same error. Can you please provide an alternate solution to this

Possible Issues

ReadyAPI cannot import OpenAPI 3.0 specifications through HTTPS if the server where your spec resides has an invalid or expired security certificate. To work around this issue:

Add the following option to the vmoptions file:

-Dio.swagger.parser.v3.util.RemoteUrl.trustAll=true
Restart ReadyAPI to apply the change.

  • The SSL certificate error you're encountering when importing the Swagger definition into ReadyAPI is commonly caused by issues with the SSL certificate's validity or configuration. Even though you've followed the suggested solution of trusting all certificates using the -Dio.swagger.parser.v3.util.RemoteUrl.trustAll=true option, it’s essential to ensure that the server’s SSL certificate is valid, not expired, or self-signed. If using a self-signed certificate, you may need to manually import it into the Java keystore. Additionally, double-check for any firewall or proxy settings that might be interfering with the connection. While changing the URL to HTTP instead of HTTPS can provide a temporary workaround, it should be avoided in production due to security risks. Lastly, make sure you're using the latest version of ReadyAPI, as newer releases often fix SSL-related issues.