LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-09-2013, 12:21 PM   #1
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 199

Rep: Reputation: 0
How to add Certificate to Apache Tomcat


Hello,
i get two file .pfx and .crt . now i want to import it to my apache tomcate server for my website https , for example i have a website (http://test.com) no i want https://test.com

any Suggestion,

Last edited by hesisaboury; 04-09-2013 at 12:30 PM.
 
Old 04-09-2013, 12:36 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,685

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by hesisaboury View Post
Hello,
i get two file .pfx and .crt . now i want to import it to my apache tomcate server for my website https , for example i have a website (http://test.com) no i want https://test.com

any Suggestion,
Google has lots of how-tos...like these:
http://www.apache.com/resources/how-...ate-on-apache/
http://www.digicert.com/ssl-certific...ion-apache.htm

Did you try to look this up??
 
Old 04-09-2013, 11:33 PM   #3
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 199

Original Poster
Rep: Reputation: 0
Thank u TB0ne
i use apache tomcat and it's different with apache , in apache i can use crt,pub and prv pem but in apache tomcat i have to use .jks and other things .. i googled too but tried many ways but i did not get answer yet .

any suggestion
 
Old 04-10-2013, 08:48 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,685

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by hesisaboury View Post
Thank u TB0ne
i use apache tomcat and it's different with apache , in apache i can use crt,pub and prv pem but in apache tomcat i have to use .jks and other things .. i googled too but tried many ways but i did not get answer yet .

any suggestion
Spell out your words, please. And if you did try to look this up, you'd have found answers. Can you tell us which "many ways" you've tried, from what links?? Putting "how to add ssl certificate to tomcat" pulls up this, as the VERY FIRST HIT, from the Tomcat site, with examples.
http://tomcat.apache.org/tomcat-3.3-...ssl-howto.html
 
Old 04-11-2013, 05:19 AM   #5
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 199

Original Poster
Rep: Reputation: 0
Hello,
i followed this : (for info i bought ssl and i have two file .pfx and .cer)
keytool -importkeystore -srckeystore [xx.p12] -srcstoretype pkcs12 -srcalias [domainname] -destkeystore [domainname.jks] -destkeystore jks -deststorepass [xxx] -desalias [domainname]

this command add ssl to my apache tomcat but one my my webmail features (attachement) does not work .. before that i used self signed certificate with no problem.....that is my problem

i also create .pfx file and .cer then imported to jks ... failed

ERRORs :
11 Apr 2013 06:25:49[ERROR] test - SendMailService.log(38) 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


caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Last edited by hesisaboury; 04-11-2013 at 05:27 AM.
 
Old 04-11-2013, 08:51 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,685

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by hesisaboury View Post
Hello,
i followed this : (for info i bought ssl and i have two file .pfx and .cer)
keytool -importkeystore -srckeystore [xx.p12] -srcstoretype pkcs12 -srcalias [domainname] -destkeystore [domainname.jks] -destkeystore jks -deststorepass [xxx] -desalias [domainname]

this command add ssl to my apache tomcat but one my my webmail features (attachement) does not work .. before that i used self signed certificate with no problem.....that is my problem
...which is NOT what you posted originally. And where did you get that command, and WHICH webmail system are you using, on what version/distro of Linux???
Quote:
i also create .pfx file and .cer then imported to jks ... failed
Again, you need to provide details. HOW did you import them, with which command(s)/to where?
Quote:
ERRORs :
11 Apr 2013 06:25:49[ERROR] test - SendMailService.log(38) 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

caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
...and AGAIN, just trying to look up the error brings up LOTS of solutions, if you bothered to look:
http://www.mkyong.com/webservices/ja...uested-target/
https://blogs.oracle.com/gc/entry/un..._certification
 
Old 04-12-2013, 02:19 AM   #7
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 199

Original Poster
Rep: Reputation: 0
Thank u TB0ne
Finally solved
i create .p12 using
http://dragotown.com/2005/08/creatin...using-openssl/
and add .crt to java cacerts (here was my problem)
keytool -import -alias domainname -file xx.crt -keystore "$JAVA_HOME/jre/lib/security/cacerts" -storepass xxx
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Session replication using apache+mod_jk+tomcat(5.5.28-veriosn of tomcat) sreejithp Linux - Server 1 12-24-2010 06:46 AM
tomcat SSL certificate import / export question *wildcarddomain.com di11rod Linux - Server 1 09-14-2010 05:00 PM
Single wildcard certificate for apache httpd server and tomcat udaykiran Linux - Server 3 02-19-2010 09:50 AM
ssl certificate generated from openssl into tomcat bradvan Linux - Security 2 07-17-2009 07:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration