HomeBlogMagic

Selfsigned Certificate with openssl

Mit dem nachfolgendem Skritpt kann mit openssl ein selbstsigniertes Zertifikat erstellt werden.

Das ist nur für Entwicklungen und Tests gedacht, und sollte niemals im Produktiv-Einsatz genutzt werden.

echo [req]> test.conf
echo distinguished_name = req_distinguished_name>> test.conf
echo x509_extensions = v3_req>> test.conf
echo prompt = no>> test.conf
echo [req_distinguished_name]>> test.conf
echo C = US>> test.conf
echo ST = VA>> test.conf
echo L = SomeCity>> test.conf
echo O = MyCompany>> test.conf
echo OU = MyDivision>> test.conf
echo CN = www.company.com>> test.conf
echo [v3_req]>> test.conf
echo keyUsage = critical, digitalSignature, keyAgreement>> test.conf
echo extendedKeyUsage = serverAuth>> test.conf
echo subjectAltName = @alt_names>> test.conf
echo [alt_names]>> test.conf
echo DNS.1 = www.company.com>> test.conf
echo DNS.2 = company.com>> test.conf
echo DNS.3 = company.net>> test.conf

openssl req -config test.conf -new -x509 -sha256 -newkey rsa:2048 -nodes -keyout Key.crt -days 365 -out Certificate.crt

rm test.conf
Permalink: https://adirmeier.de/Blog/ID_270
Tags: Blog, Linux, openssl, Windowsvon am 2019-07-21