Making POST request on HTTPS using Jira API in a Jira instance

Viewed 75

My Jira instance is running on an HTTPS port. I have written a script that creates sub-tasks of a task in a project using a Jira API POST request on the Jira instance. It was working fine on my HTTP version. When I shifted to the HTTPS version, it started giving errors.

Error 1:

It gave the certificate error that was not present in Java.

Resolution. I resolved the issue using the below commands in my Jira instance.

openssl x509 -in <(openssl s_client -connect 192.168.2.214:8083 -prexit 2>/dev/null) -out ~/server-name.crt

keytool -importcert -file ~/server-name.crt -alias server-name -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit

My Instance is running on AWS and has different internal and external IPs to access it.

The problem I am facing after resolving the above issue is :

javax.net.ssl.SSLHandshakeException: No subject alternative names matching IP address 192.168.2.214 found
at Script2.run(Script2.groovy:11)
Caused by: java.security.cert.CertificateException: No subject alternative names matching IP address 192.168.2.214 found
... 1 more

My internal IP is 192.168.2.214 and my external IP is different from it.

My external IP is mapped to a URL and the certificate is purchased against that URL.

How do I get rid of this error as I only can access my HTTPS port using the internal IP when making an API call and there is no HTTP port defined. If I define an HTTP port, I would need to reconstruct my whole instance which is not possible at the moment.

0 Answers
Related