Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Linux Ubuntu: importing the server certififcate, no keytool command?

esome June 21, 2016

This question is in reference to Atlassian Documentation: Configuring an SSL Connection to Active Directory

 

This question is in reference to Atlassian Documentation: Configuring an SSL Connection to Active Directory
Hello Community,
I have a problem to connect confluence to our Microsoft AD Server with write/read option via SSL (LDAPS). Every time I try to do a quick test, after enabling the option "Use SSL" in the "Configure LDAP User Directory" Dialog with "Read/Write"-Permission, i get the following message after pressing the "Quick Test"-Button:

##############
Connection test failed. Response from the server:
ad1.domain.com:636; nested exception is javax.naming.CommunicationException: ad1.domain.com:636 [Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]
##############

Without the ssl-option the test passes. At the moment (without enabled ssl option) it is possible for us to login via Windows AD login credentials into confluence. But we want the ability to change the windows AD user password via confluence. So I think the ssl connection is required for this intentions.

So what is the problem? What do i have to change?

I've tried to import our ad1-Server-Cert (filename ad1.crt) on our confluence server (actual Ubuntu Linux 64-bit edition) and followed the manual Configuring an SSL Connection to Active Directory but for me it is not possible to import our ad1-Serer-Cert. After trying the command "sudo keytool -importcert -keystore ./cacerts -file ad1.crt" I'm getting the following error message "sudo: keytool: Command not found". I've copied the ad1.crt file to the following directory "/opt/atlassian/confluence/jre/lib/security".
I've installed confluence via the Linux Installer file (atlassian-confluence-5.9-10-x64.bin), I used the "Express Install"-Option.

Thank you very much!

Kind regards,
Matthias

 

 

4 answers

1 vote
esome June 21, 2016

Thank you for your quick response. There is no variable $JAVA_HOME. Yesterday I read, that JRE will be installeg automatically via the Linux installer and Express Installation option.

I've tried the following two commands:

sudo $JAVA_HOME/keytool -importcert -keystore ./cacerts -file ad1.crt

sudo $JRE_HOME/keytool -importcert -keystore ./cacerts -file ad1.crt

result: /keytool: Command not found

Do I have to set up the variable $JAVA_HOME ? I thought the installer will do it for me?

Thanks. Matthias

Jonas Andersson
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.
June 22, 2016

do this:

ps axuww | grep java | grep jira
#here you should be able to see which java it uses to start jira

#update the mlocate database
sudo updatedb
#search for the keytool
locate keytool

#then use the direct path that it finds for keytool. Make sure it's in the same path as the java used to start jira.

 

Additionally, it makes sense to do an

export JAVA_HOME="/path/to/jdk"

in .bashrc, .profile, /etc/profile or any other files used to set up the JIRA users environment, as this path also refers to cacert files and other candy that your system will use if/when using SSL.

 

Jonas Andersson
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.
June 22, 2016

ps. "/path/to/jdk" should be replaced with the dir to your JDK.

If it finds your keytool in: /opt/java/jdk1.8.0_65/bin/keytool

your JAVA_HOME should be set to: /opt/java/jdk1.8.0_65/

Additionally, if the java that executed JIRA is in /opt/atlassian/jira/... it uses the bundled JRE instead of a JDK. In that case there is no use to set the JAVA_HOME as JIRA already is aware of it anyway.

Jonas Andersson
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.
June 22, 2016

And by JIRA, i mean confluence smile

0 votes
Matthias Wolf
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 23, 2016

Thank you for your help. I've found the right directories (keytool + cert-dir) and imported our ad1.crt file succesfully. From now on the SSL connection (read/write) works! User can now change their Windows AD password via confluence.

Kind regards,

Matthias

0 votes
Nic Brough -Adaptavist-
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.
June 21, 2016

If you are using a relatively recent version of Confluence, then it has shipped with, and installed, Java for you.

You should be able to go to <confluence installation> and do it all within that.  A quick look at my install that's using certs is below.  You'll need to specify the right paths if you leave your Java home blank

 

nic@zen:/opt/confluence/jre$ echo $JAVA_HOME

nic@zen:/opt/confluence/jre$ find . | egrep "cacerts|keytool"
./lib/security/cacerts
./man/man1/keytool.1
./man/ja_JP.UTF-8/man1/keytool.1
./bin/keytool

0 votes
Jonas Andersson
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.
June 21, 2016

Command not found speaks for itself.. Try replacing the 'keytool' with '$JAVA_HOME/keytool' and it should work.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events