0

Very new to SSL installation in Tomcat 8.5. OS: CentOS 7

I have SSL certificates from GoDaddy and have the private key used to generate the certificates. This private key was shared in a .txt file and I copied it into a .key file to distinguish it from other files. It is stored in a file sitename.com.key

In a bundle from GoDaddy downloaded for Tomcat following files are present

  1. a-hash-code.crt
  2. a-hash-code.pem
  3. gd_bundle-g2-g1.crt
  4. gdig2.crt.pem

Going through Tomcat 8.5 documentation and other guides I have done the following steps to create a keystore and import certificates into the keystore.

  1. sudo keytool -import -trustcacerts -alias intermediate -file gd_bundle-g2-g1.crt -keystore keystore-name.keystore
  1. sudo keytool -import -trustcacerts -alias root -file a-hash-code.crt -keystore keystore-name.keystore

Importing Private Key into the Keystore

  1. sudo openssl pkcs12 -export -name servercert -in gd_bundle-g2-g1.crt -inkey sitename.com.key -out p12keystore.12

This step 3 throws error in terminal

unable to load private key

140041401685904:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:707:Expecting: ANY PRIVATE KEY

Private Key file is of the following format

-----BEGIN PRIVATE KEY-----

Hash

-----END PRIVATE KEY-----

Checked key file mime type and it shows UTF8.

$ file -i sitename.com.key

sitename.com.key: text/plain; charset=utf-8

OpenSSL Version

OpenSSL 3.0.7 1 Nov 2022 (Library: OpenSSL 3.0.7 1 Nov 2022)

What is the problem here?

Vishnu
  • 1
  • 1
  • 2

0 Answers0