Error setting up gmail in Jira 6.3.3 (SunCertPathBuilderException)

Thijs Baars August 13, 2014

I'm trying to setup a SMTP server in JIRA to let it email notifications and what not.

If I select Gmail / Google Apps host in the dropdown, and then fill in my details, I get a red error box after trying to test the connection:

Unfortunately no connection was possible. Review the errors below and rectify:
SunCertPathBuilderException: unable to find valid certification path to requested target

I figured this has something to do with missing SSL certificates (which seems odd. You'd figure these would be included in the package). I followed the steps in https://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+servicesand then the commandline installation.

One weird thing: JAVA_HOME is set to a path that doesn't exist. So I used full paths to install the key:

sudo /opt/atlassian/jira/jre/bin/keytool -import -alias google.com -keystore /opt/atlassian/jira/jre/lib/security/cacerts -file public.crt

However, this doesn't help either, the error persists.

I tried using the SSL-plugin, but that also fails. (class javax.net.ssl.SSLException during connection to google.com:443...)
Strange: on the secure/admin/ConfigureSsl1.jspa page it does show the Google CN: CN=*.google.com, O=Google Inc, L=Mountain View, ST=California, C=US

I'm out of options. I can't find a solution online either, but maybe I used the wrong keywords :(

Can someone point me towards the correct direction?

---------------- EDIT --------------------

I replaced all cacerts files on the system (openJDK 1.6/1.7 dirs and the JIRA dir), but that didnt help :(

Even if I use a normal SMTP server (non-SSL/port 25) on smtp.ziggo.nl I get the error :(

Using a secondary Google Apps acount, of which I am administrator, same results :(

------------------ EDIT ---------------------------

3 answers

1 accepted

0 votes
Answer accepted
Thijs Baars August 17, 2014

After seeing the above error that persisted even if no SSL was required, I went on searching for other errors in the logs, which lead me to https://jira.atlassian.com/browse/JRA-39526

This fixed the missing Cacert/SSL stuff. I know have an error with authentication, but that seems related to using an external JRE.

I'm opening a seperate issue for that...

1 vote
Andris Grinbergs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2014

Hi,

Some ideas,

1. check server date.

2. you may be using java from different JAVA_HOME

3. Check if you don't have "smart" gateway/proxy which captures all HTTPS traffic and replaces SSL certificate with company/gateway generated.

4. You need to restart Jira after you modify cacerts.

Andris.

Thijs Baars August 13, 2014

The server date (bash date) states local time, I expect this is correct.

I reset my JAVA_HOME vars to the jre directory in the /opt/atalssian/jira/ folder.

The VPS is hosted at the ISP in a datacentre in Amsterdam. No proxies or whatever in between.

I restarted Jira, but nothing changed. Perhaps I need to flush a cache?

1 vote
Tiago Comasseto
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2014

Hi Thijs, the JVM shipped with JIRA should have google certificate in it already, but I've seen this error in the past and in my case the problem was that the cacerts file got corrupted somehow.

One thing you can do is download a new JAVA installation packet from Oracle site, decompress it and just replace your current cacerts file by the one from this new installation packet. (this will require JIRA restart)

I hope it helps.

Cheers

Thijs Baars August 13, 2014

see edit, unfortunately that didn't work either :(
I deletred the ._cacerts file, which seems to be used for caching, but no sigar

Suggest an answer

Log in or Sign up to answer