https://www.sslsupportdesk.com/how-to-move-ssl-certificate-from-apache-to-tomcat/

Apache uses x509 pem/crt  files which is  is very different than a Tomcat system that uses keystores. You will follow these steps to copy, convert, and move the working Apache certificate to the Tomcat server.

Both Apache and Tomcat are very customizable. The directory location and naming of the individual files needed vary depending on your personalized system. Below are generalized instructions.

We will start by assuming that you have already successfully installed the SSL certificate on the Apache web server.

Step 1: Finding/converting your SSL certificate and key file on Apache:

  1. Referencing the httpd.conf or ssl.conf file on the Apache system look for the location and directories of the three files necessary.

    • SSLCertificateFile /usr/local/ssl/crt/public.crt  
      SSLCertificateFile tells Apache how to find the the SSL certificate file.
    • SSLCertificateKeyFile /usr/local/ssl/private/private.key
      SSLCertificateKeyFile tells Apache how to find the private key file.
    • SSLCertificateChainFile /usr/local/ssl/crt/intermediate.crt
      SSLCertificateChainFile or SSLCACertificateFile tells Apache the location of the Intermediate file.
  2. Copy the three files located within these directories into one location.
  3. Using OpenSSL on the Apache system you will perform the following command line conversion.
    Note: you will be prompted for a password.openssl
    pkcs12 -export -in public.crt -inkey private.key -out mycert.p12 -name
    tomcat -CAfile intermediate.crt -caname intermediate -chain
  4. The exported keystore will be ‘mycert.p12‘ and will be ready for you to migrate to the Tomcat server.

Step 2: Configuring SSL in Tomcat with your keystore:

  1. On the Tomcat server search and open the Tomcat server.xml file.
  2. Open the server.xml config file using a text editor (ie. JAKARTA_HOME/conf/server.xml)
    Search for the secure element in your config file (try searching
    for SSL Connector). By default it should look something like this:

  3. Change the following attributes to reference the location, name, and password of your keystore.
    • keystoreFile=”c:\PATH TO mycert.p12”
    • keystorePass=”password of mycert.p12”
  4. Add The following line under KeystorePass=
    • keystoreType=”PKCS12″
  5. Save the changes.
  6. Stop and Start Tomcat.Your SSL Certificate/Keystore is now installed, and the website is now configured.

Note: PKCS12 keystore type is only supported with Tomcat JDK 1.5.x+

If unsuccessful you will have to
convert your  mycert.p12 file to a .jks file by performing the following
command line in Tomcat using keytool.

keytool -importkeystore -srckeystore mycert.p12 -srcstoretype PKCS12 -destkeystore mycert.jks

If this fails and you cannot get
Tomcat to use the Apache converted keystore you will need to generate a
new keystore and CSR from the Tomcat System and reissue your certificate
to be used on the Tomcat system.

Tomcat Support

For more information refer to Tomcat

How to Move SSL certificate from Apache to Tomcat的更多相关文章

  1. How To Create a SSL Certificate on Apache for CentOS 6

    About Self-Signed Certificates 自签证书.一个SSL证书,是加密网站的信息,并创建更安全的链接的一种方式.附加地,证书可以给网站浏览者显示VPS的的身份证明信息.如果一个 ...

  2. How To Set Up Apache with a Free Signed SSL Certificate on a VPS

    Prerequisites Before we get started, here are the web tools you need for this tutorial: Google Chrom ...

  3. SSL certificate problem unable to get local issuer certificate解决办法

    SSL certificate problem unable to get local issuer certificate 解决办法: 下载:ca-bundle.crt 将它放在自己的wamp或者x ...

  4. Centos 64位 Install certificate on apache 即走https协议

    Centos 64位 Install certificate on apache 即走https协议 一: 先要apache 请求ssl证书的csr 一下是步骤: 重要注意事项 An Importan ...

  5. Failed to connect to VMware Lookup Service……SSL certificate verification failed

    今天登陆vsphere web-client时候,报错如下: Failed to connect to VMware Lookup Service https://vc-test.cebbank.co ...

  6. How to disable SSL certificate checking with Spring RestTemplate?(使用resttemplate访问https时禁用证书检查)

    How to disable SSL certificate checking with Spring RestTemplate?(使用resttemplate访问https时禁用证书检查) **** ...

  7. 使用Letsencrypt做SSL certificate

    为什么要使用Letsencrypt做SSL certificate? 最简单直接的原因是免费.但是免费存在是否靠谱的问题,尤其是对安全要求比较高的网站,需要考虑使用letsencrypt的安全性是否符 ...

  8. Configure custom SSL certificate for RDP on Windows Server 2012 in Remote Administration mode

    Q: So the release of Windows Server 2012 has removed a lot of the old Remote Desktop related configu ...

  9. (转)How to renew your Apple Push Notification Push SSL Certificate

    转自:https://blog.serverdensity.com/how-to-renew-your-apple-push-notification-push-ssl-certificate/ It ...

随机推荐

  1. iOS 取消多余tableView的横线的写法

    - (void)setExtraCellLineHidden: (UITableView *)tableView{ UIView *view =[ [UIView alloc]init]; view. ...

  2. HDU 5317 RGCDQ(素数个数 多校2015啊)

    题目链接:pid=5317" target="_blank">http://acm.hdu.edu.cn/showproblem.php?pid=5317 Prob ...

  3. NSUserDefaults:通常用来保存一些小巧的数据,如用户的用户名密码,或者是用户的使用习惯,如是否自动打开背景音乐等。

    1,NSUserDefaults通常用来保存一些小巧的数据,如用户的用户名密码,或者是用户的使用习惯,如是否自动打开背景音乐等. 2,使用它的原因就是:代码简短,使用方便 3,使用方法如下: -(vo ...

  4. PHP基本的文件和文件夹操作常用的汇总

    资源:http://www.ido321.com/835.html 一.基本文件的操作 文件的基本操作有:文件推断.文件夹推断.文件大小.读写性推断.存在性推断及文件时间等 1: <?php 2 ...

  5. C 删除字符串1字符串2

    #include<stdio.h> #include<string.h> void main() { char s1[1000],s2[100],b[100]; int i,j ...

  6. Matlab使用鼠标标注图像位置并返回坐标(标注图像ROI)

    代码 function ROI=LabelBox(filename) Mat=imread(filename); imshow(Mat); mouse=imrect; pos=getPosition( ...

  7. bash实现多进程运行

    之前一段时间,发现线上日志服务器总是会突然丢失日志,碰到问题时搞的很被动.联系运维同学,又总是被往后推(后来看了一下日志归档脚本,运维同学写的bug).索性自己写了一个脚本,添加到crontab任务中 ...

  8. javaS的tring和androidS的tring区别是什么?

    这是今天阿里电话面试被问到的,在之前确实没有想过(一直以为是一样的),于是面试完之后,我立即打开了源代码,对这两个String类进行了比較,以下是我的发现. 首先我观察了这两个String类所导入的包 ...

  9. 【Android工具类】用户输入非法内容时的震动与动画提示——EditTextShakeHelper工具类介绍

    转载请注明出处:http://blog.csdn.net/zhaokaiqiang1992 当用户在EditText中输入为空或者是数据异常的时候,我们能够使用Toast来提醒用户,除此之外,我们还能 ...

  10. Editplus配置Python的开发环境

    Python 有很多集成开发工具,商业的有komodo,Wingide,Boa 等,还有Python 自带的集成环境IDLE,Windows 下还有PythonWin 等.但是,这些工具有的是过于复杂 ...