Score:0

openssl PEM_read_bio:no start line:pem_lib.c:707:Expecting: ANY PRIVATE KEY

uz flag

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?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.