Net Assured

Net Assured

Network and Security Consultancy

T 07789 400408
Email: info@netassured.co.uk

Net Assured Limited
84 Goodacre, Orton Goldhay, Peterborough, PE2 5LZ

  • Home
  • Services
  • Blog
  • About
  • Contact
FREEQUOTE

Using OpenSSL to generate CSR’s with Subject Alternative Name

Friday, 19 May 2017 / Published in Security

Using OpenSSL to generate CSR’s with Subject Alternative Name

This post details how I’ve been using OpenSSL to generate CSR’s with Subject Alternative Name Extensions. You may have noticed that since Chrome 58, certificates that do not have Subject Alternative name extensions will show as invalid. Amazing, I must have missed the memo on that. Most of the certificates I use in my home lab do not have these extensions so I was getting untrusted certificate warnings. Yes, you can waive your “but certifcates should contain SAN as per the RFC” flag at me but if the device you generate the CSR from does not support adding subject alternative name extensions you have to generate them manually. I’ve had to regenerate pretty much all the certificates in my lab using OpenSSL.

This is the process I followed using OpenSSL on Ubuntu:

Step 1 – Create an OpenSSL configuration file

Create a configuration file and populate the details you need specific to you CSR. In the below example I was generating a new one for my prtg server:

more openssl-csr.conf
[ req ]
default_bits       = 2048
distinguished_name = req_distinguished_name
req_extensions     = req_ext
[ req_distinguished_name ]
countryName                 = GB
stateOrProvinceName         = Cambs
localityName               = Peterborough
organizationName           = Net Assured Limited
commonName                 = Common Name (e.g. server FQDN or YOUR name)
[ req_ext ]
subjectAltName = @alt_names
[alt_names]
DNS.1   = prtg1.corp.netassured.co.uk
DNS.2   = www.prtg1.corp.netassured.co.uk

Step 2 – Using OpenSSL to generate CSR’s with Subject Alternative Name extensions

Generate the request pulling in the details from the config file:

sudo openssl req -out prtg1-corp-netassured-co-uk.csr -newkey rsa:2048 -nodes -keyout prtg1-corp-netassured-co.uk.key -config openssl-csr.conf

You’ll notice that you’ll not be prompted for the SAN extensions but they’ll still be present in the CSR. You can view them by running:

openssl req -noout -text -in prtg1-corp-netassured-co-uk.csr

Now proceed as normal to have your certificate signed by a CA, import to your devices and hopefully not receive any more untrusted certificate errors.

Tagged under: Security, SSL

Categories

  • Automation
  • Networking
  • Security
  • Starlink
  • Ubiquiti UniFi

NEWSLETTER SIGNUP

By subscribing to our mailing list you will always be updated with the latest news from us.

We never spam!

Menu

  • Home
  • Services
  • Blog
  • About
  • Contact
  • Privacy Policy
  • Cookie Policy

Get In Touch

T 07789 400408
Email: info@netassured.co.uk
NET ASSURED LIMITED
84 Goodacre | Orton Goldhay
Peterborough | PE2 5LZ
Company Registration: 9480811
VAT Registration: 207 5161 32
  • GET SOCIAL

© 2015 - 2026 Copyright by Net Assured Limited | All rights reserved

TOP
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behaviour or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}