Создание SSL сертификата
- Автор: Silver
- Просмотров: 142
Создаём самоподписанный SSL сертификат.
1. Собираем случайные данные
> cat /dev/random > ./random
2. Создаём ключ
> openssl genrsa -des3 -out ./server.key -rand ./random
256 semi-random bytes loaded Generating RSA private key, 1024 bit long modulus .++++++ .............................................++++++ e is 65537 (0x10001) Enter pass phrase for ./server.key: Verifying - Enter pass phrase for ./server.key:
3. Подписаваем ключ и создаём сертификат
> openssl req -new -x509 -key ./server.key -out ./server.crt Enter pass phrase for ./server.key: You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:RU State or Province Name (full name) [Some-State]:Moscow Locality Name (eg, city) []: Organization Name (eg, company) [Internet Widgits Pty Ltd]:MyCompany Inc Organizational Unit Name (eg, section) []: Common Name (e.g. server FQDN or YOUR name) []:localhost Email Address []: