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. 使用Boolean类型同步锁引起异常的分析

    原文地址 http://topic.csdn.net/u/20080710/19/f61cb4db-ddff-4457-a26a-4ea578b0cc6c.html?87447500 http://w ...

  2. 使用Fiddler对android应用抓包 专题

    工作原理 先上个图 此图一目了然,可以看出fiddler在请求中所处的位置,我们就可以确定它能干些什么. WinInet(“Windows Internet”)API帮助程序员使用三个常见的Inter ...

  3. Codeforces C. Pattern 412 解决问题的方法

    这个问题是比较暴力的法律主体. 主要是检查每一个是否没有使用足够的?.假设优先使用其他的无论是什么字母,假设你一定不能使用?. 找一个有能力并给予所有的字符串匹配字符串,而且采用的最小?号码. 原标题 ...

  4. NET媒体文件操作组件TagLib

    开源的.NET媒体文件操作组件TagLib#解析   人生得意须尽欢 莫使金樽空对月.写博客都会在吃饭后,每次吃饭都要喝上二两小酒,写博客前都要闲扯,这些都是个人爱好,改不掉了,看不惯的人,还望多多包 ...

  5. HTML5 的成长之路

    html5历史 w3c从2008年提出html5的概念,目前html5的版本已经趋于稳定,也逐步得到了业界的认可和接受. 以前我们有一个疑问,HTML5与Flash究竟谁将在移动互联网时代称霸市场?这 ...

  6. C++ Lambda表达式基本用法(言简意赅,非常清楚)

    创建一个匿名函数并执行.Objective-C采用的是上尖号^,而C++ 11采用的是配对的方括号[].实例如下: 1 2 3 4 5 6 7 8 9 #include <iostream> ...

  7. Swift类和结构

    类和结构有非常多的共同点: 定义属性存储数据 定义方法执行功能处理 定义下标,通过下标訪问他们的值 初始化他们的状态 通过扩展(Extension)扩展其功能 遵守协议(Protocol).协议提供一 ...

  8. QT 调用 DLL 方法(三种方法)

    Qt调用DLL方法一:使用Win32 API 在显式链接下,应用程序必须进行函数 调用以在运行时显式加载 DLL.为显式链接到 DLL,应用程序必须:? 调用 LoadLibrary(或相似的函 数) ...

  9. DDD实战6 WebAPI

    1.在Products解决方案文件夹下面新建一个项目 .net Core/Asp.net Core Web应用程序  取名Product.WebApi/选择Web Api core2.0版本 不进行身 ...

  10. EF codefirst第一篇

    一直以来喜欢dbfirst  因为简单,一直不明白为什么codefirst会是主流,根据对ddd的学习终于知道了codefirst的目的 本文是对博客园 小崔的笔记本 文章 EF实体框架之CodeFi ...