OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 18.1 Legacy Series »
  • Base64 certificate
« previous next »
  • Print
Pages: [1]

Author Topic: Base64 certificate  (Read 3355 times)

SteveK

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
Base64 certificate
« on: February 15, 2018, 11:57:35 am »
Hi,

I have implemented an internal CA and an intermediate CA...and everything works fine with the generated internal server certificates :).

Trying to configure a switch for HTTPS, I found out that it needs a BASE64 certificate. When an internal certificate is created, then there are a .crt, a .key, and a .p12 files that can be downloaded. How can I generate a BASE64 certificate and key (?!) using those files?

Regards,
Steve
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Base64 certificate
« Reply #1 on: February 15, 2018, 05:51:19 pm »
What Base64 certificate? There are different formats of certificates like DER and PEM where the content between the delimiters in PEM is Base64 encoded.

OpenSSL can convert between the formats.
Logged

SteveK

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
Re: Base64 certificate
« Reply #2 on: February 15, 2018, 08:09:28 pm »
The only info that I found so far is...the certificate and private keys must be in RSA PEM format.

Would these be the right commands for converting?

openssl rsa -in switch1.key -outform PEM -out switch1.crt.pem

openssl x509 -in switch1.crt -outform PEM -out switch1.key.pem
Logged

bartjsmit

  • Hero Member
  • *****
  • Posts: 1540
  • Karma: 166
    • View Profile
Re: Base64 certificate
« Reply #3 on: February 15, 2018, 08:16:12 pm »
Both the .crt and the .key file are in the correct (PEM) format, which as Fabian has pointed out, uses Base64 encoding.

Bart...
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Base64 certificate
« Reply #4 on: February 15, 2018, 09:36:45 pm »
Quote from: SteveK on February 15, 2018, 08:09:28 pm
The only info that I found so far is...the certificate and private keys must be in RSA PEM format.

Would these be the right commands for converting?

openssl rsa -in switch1.key -outform PEM -out switch1.crt.pem

openssl x509 -in switch1.crt -outform PEM -out switch1.key.pem

You may need "-inform DER" to make it working if your key is in DER format but OpenSSL will tell you if it tries to use the wrong format.
Logged

SteveK

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
Re: Base64 certificate
« Reply #5 on: February 19, 2018, 09:49:54 pm »
It worked with the PEM!

And the correct command were:

openssl x509 -in sw1.crt -outform PEM -out sw1.crt.pem
openssl rsa -in sw1.key -outform PEM -out sw1.key.pem

Thanks for the help!
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 18.1 Legacy Series »
  • Base64 certificate
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2