06-23-2020 03:33 PM
(config)#ip ssl private-key-file tftp 1.2.3.4 key.pemThis consistently fails with error:
Downloading RSA private key file, please wait... Done. Download RSA certificate data file to create the certificate.
(config)#ip ssl certificate-data-file tftp 1.2.3.4 cert.pem Downloading RSA certicate data file, please wait... Done. Creating certificate, please wait...
Cert import failed....Could not parse the PEM-encoded import dataThings I've tried:
06-26-2020 06:48 PM
-----BEGIN PRIVATE KEY-----
"); it only supports PKCS #1 ("-----BEGIN RSA PRIVATE KEY-----
").07-03-2022 08:52 AM
People suggested how to do it. Here is an example that I tested and is working on my Brocade ICX6610-48P. Although ip ssl cert-key-size says "SSL server certificate key size (range: 2048 or 4096)" I found this only worked with 2048 sized keys. It also says in the documentation that it can be up to 4096 bits but that's not necessarily true. I guess it depends on the device, maybe newer models can support larger keys. Using 4096 for the CA is okay though.
printf "\e[32mGenerate new "$name" Root CA\e[0m\n" \ pass='{{ pass }}' \ name='{{ name }}' \ openssl req \ -newkey rsa:4096 \ -sha512 \ -passin pass:"${pass}" \ -x509 \ -nodes \ -keyout "$name"Root.pem \ -new \ -out "$name"Root.crt \ -subj "/CN="$name" Root CA" \ -days 3650
openssl genrsa -traditional -out keyfile 2048
openssl rsa -traditional -in keyfile -pubout -out keyfile.public
name='{{ name }}' \ C='{{ country }}' \ ST='{{ state/province }}' \ openssl req \ -new \ -sha512 \ -key keyfile \ -subj "/C="$C"/ST="$ST"/O="$name" Network, Inc./CN=sw1.home.arpa" \ -out certsignreq.csr \ -reqexts SAN \ -extensions SAN \ -config <(cat /etc/ssl/openssl.cnf ; printf "[SAN]\nsubjectAltName=DNS:%s" "sw1.home.arpa")
name='{{ name }}' \ openssl x509 \ -req \ -in certsignreq.csr \ -CA "$name"Root.crt \ -CAkey "$name"Root.pem \ -CAcreateserial \ -out certfile \ -days 3650 \ -sha512 \ -extensions v3_ext \ -extensions SAN \ -extfile <(cat /etc/ssl/openssl.cnf ; printf "[SAN]\nsubjectAltName=DNS:%s" "sw1.home.arpa")
conf t crypto-ssl certificate zeroize ip ssl cert-key-size 2048 ip ssl certificate-data-file tftp 192.168.1.51 certfile ip ssl private-key-file tftp 192.168.1.51 keyfile web-management https
07-01-2020 12:33 AM
08-14-2020 10:29 AM