生成自签名证书$ openssl genrsa -out server.key 1024Generating RSA private key, 1024 bit long modulus......
生成自签名证书
$ openssl genrsa -out server.key 1024
Generating RSA private key, 1024 bit long modulus.........................++++++.........................++++++e is 65537 (0x10001)
$ openssl req -new -key server.key -out server.csr
You are about to be asked to enter information that will be incorporatedinto 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 blankFor some fields there will be a default value,If you enter '.', the field will be left blank.-----Country Name (2 letter code) [AU]:CNState or Province Name (full name) [Some-State]:123Locality Name (eg, city) []:123Organization Name (eg, company) [Internet Widgits Pty Ltd]:123Organizational Unit Name (eg, section) []:123Common Name (e.g. server FQDN or YOUR name) []:192.168.59.103Email Address []:Please enter the following 'extra' attributesto be sent with your certificate requestA challenge password []:An optional company name []:
$ openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt
Signature oksubject=/C=CN/ST=123/L=123/O=123/OU=123/CN=192.168.59.103Getting Private key