21

Secure Socket Layer (SSL), Netscape 1994 , . SSL- -. OpenSSL - SSL. , , .

, OpenSSL.

  OpenSSL

Linux 5


SSL? SSL?

Secure Socket Layer (SSL) - , .

, SSL - , , .

, SSL -, , , , . 128 256- SSL.

SSL , , . , SSL- , , .

TLS SSL?

Ÿ ! Transport Layer Security (TLS) - Secure Socket Layer (SSL). , TLS, SSL.

, - SSL?

, , , , - https. , - SSL. , , SSL.

SSL

SSL-?

. -, , - , , . SSL HTTPS . , , , .

, SSL- SEO Google, , , . , SSL , Google . , 2018 Google SSL .

SSL?

SSL (CA - Certificate Authorities). , CSR (Certificate Signing Request - ) , SSL. CSR , CA .

  1. CSR . (public key) (private key) .
  2. CSR , , , . , , CSR, .
  3. SSL, , . .
  4. , (trusted root) . HTTPS-.
, . , Google Chrome Symantec, Symantec . , , Symantec, .

SSL-

, , . :


SSL-

. SSL , , . .

(DV SSL - Domain Validation)

SSL , -. , .

(EV SSL - Extended Validation)

, EV. , :

  1. ,
  2. , SSL
  3. EV SSL

SSL

, (CSR), , , .

CSR OpenSSL.

OpenSSL - CSR- SSL-, OpenSSL. SSL/TLS, 65% -, .

OpenSSL Debian Ubuntu

, OpenSSL :

dpkg -l |grep openssl

OpenSSL , :

ii libgnutls-openssl27:amd64   2.12.23-12ubuntu2.4   amd64   GNU TLS library - OpenSSL wrapper

ii openssl   1.0.1f-1ubuntu2.16   amd64   Secure Sockets Layer toolkit - cryptographic utility

, OpenSSL:

apt-get install openssl

OpenSSL Red Hat CentOS

Red Hat ( 7.0 ) OpenSSL. IDEA, RC5 MDC2, .

, OpenSSL yum (, Red Hat CentOS), :

rpm -qa | grep -i openssl

:

openssl-1.0.1e-48.el6_8.1.x86_64
openssl-devel-1.0.1e-48.el6_8.1.x86_64
openssl-1.0.1e-48.el6_8.1.i686

, , OpenSSL . OpenSSL:

yum install openssl openssl-devel

(CSR)?

(CSR - Certificate Signing Request) . , , , , SSL.

CSR , SSL. . CSR . . .

SSL , . , SSL- .

CSR, , , , , CSR. , , SSL , .

CSR :


Common Name FQDNFQDN (fully qualified domain name) - .
, -
wiki.merionet.ru
Organization Name (e.g., company) , , LLC, Corp Merion Networks LTD
Organizational Unit Name , Technology Division
Locality Name, Moscow
State/Region/Province (full name) , Moscow
Country Code (2 letter code), . ISORU
Email Address , - info@merionet.ru
Public Key , CSR .

.
.

, , . : < > ~! @ # $% ^ * / \ ()?., &


CSR

(CSR) - . SSL, . , SSL-.

- , . , .

, . - , . .

2048 . 4096 , SSL- . - - 2048- .

1: CSR

, , - 2048- RSA . , . Java key , OpenSSL.

(CSR), OpenSSL:

openssl req out certificatesigningrequest.csr -new -newkey rsa:2048 -nodes -keyout privatekey.key

:

  • openssl - OpenSSL
  • req - , CSR
  • out - , CSR. certificatesigningrequest.csr
  • new newkey -
  • rsa:2048 - c 2048- RSA
  • nodes - DES, PKCS#12
  • keyout - ,

, :

Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:

CSR . , OpenSSL, .csr.

ls *.csr

, , .

.csr , nano, - .

sudo nano your_domain.csr
nano

, CSR , , , . CSR , OpenSSL:

openssl req -in server.csr -noout -text

CSR , , . CSR-, , CSR, sslshopper.

2. CSR

, CSR. - , OpenSSL:

openssl req -out CSR.csr -key privateKey.key -new

3. CSR

openssl x509 -x509toreq -in certificate.crt -out CSR.csr -signkey privateKey.key

, , - , , CSR. SSL CSR, . -x509toreq .

4: (self-signed)

, . , OpenSSL:

openssl req -newkey rsa:2048 -nodes -keyout domain.key-x509 -days 365 -out domain.crt

days 365, , 365 . x509 , . CSR , . , nodes.

. , , . , , .

5: CSR

CSR , :

openssl x509 -signkey domain.key -in domain.csr -req -days 365 -out domain.crt

days 365, , 365 .

CSR

, CSR-. :

sudo cat domain.csr

domain FQDN CSR. CSR. , BEGIN CERTIFICATE REQUEST END CERTIFICATE REQUEST.

- CSR

, - CSR , , . CSR . - , .

SSL- . .


CSR, SSL-

, , CSR, . , SSL- :

CSR

CSR , :

openssl req -text -noout -verify -in server.csr

:

openssl rsa -in server.key -check

SSL

, , OpenSSL:

openssl x509 -in server.crt -text noout

PEM Base-64, . , , , , , . :

-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQCVqGpH2S7F0CbEmQBgmbiDiOOGxhVwlG+yY/6OBQoPKcx4Jv2h
vLz7r54ngjaIqnqRNP7ljKjFLp5zhnAu9GsdwXbgLPtrmMSB+MVFHTJvKjQ+eY9p
dWA3NbQusM9uf8dArm+3VrZxNHQbVGXOIAPNHTO08cZHMSqIDQ6OvLma7wIDAQAB
AoGAbxKPzsNh826JV2A253svdnAibeSWBPgl7kBIrR8QWDCtkH9fvqpVmHa+6pO5
5bShQyQSCkxa9f2jnBorKK4+0K412TBM/SG6Zjw+DsZd6VuoZ7P027msTWQrMBxg
Hjgs7FSFtj76HQ0OZxFeZ8BkIYq0w+7VQYAPBWEPSqCRQAECQQDv09M4PyRVWSQM
S8Rmf/jBWmRnY1gPPEOZDOiSWJqIBZUBznvOPOOQSH6B+vee/q5edQA2OIaDgNmn
AurEtUaRAkEAn7/65w+Tewr89mOM0RKMVpFpwNfGYAj3kT1mFEYDq+iNWdcSE6xE
2H0w3YEbDsSayxc36efFnmr//4ljt4iJfwJAa1pOeicJhIracAaaa6dtGl/0AbOe
f3NibugwUxIGWkzlXmGnWbI3yyYoOta0cR9fvjhxV9QFomfTBcdwf40FgQJAH3MG
DBMO77w8DK2QfWBvbGN4NFTGYwWg52D1Bay68E759OPYVTMm4o/S3Oib0Q53gt/x
TAUq7IMYHtCHZwxkNQJBAORwE+6qVIv/ZSP2tHLYf8DGOhEBJtQcVjE7PfUjAbH5
lr++9qUfv0S13gXj5weio5dzgEXwWdX2YSL/asz5DhU=
-----END RSA PRIVATE KEY-----

, , CSR, . SSL- .

,

md5 . :

openssl x509 -noout -modulus -in server.crt| openssl md5
openssl rsa -noout -modulus -in server.key| openssl md5

SSL

. , , , , , . , . , - CSR.

?

, , , .

Nginx

.

( /var/www/) . ssl_certificate_key, .

ssl_certificate_key, , SSL. - ssl.conf.

Apache

OpenSSL Apache /usr/local/ssl. openssl version a, OpenSSL, , OpenSSL .

, . :

OpenSSL 1.0.2g  1 Dec 2016

built on: reproducible build, date unspecified

platform: debian-amd64

options: bn(64,64) rc4(16x,int) des(idx,cisc,16,int) blowfish(idx)

compiler: cc -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -

D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -g -O2 -fstack-protector-

strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-

Bsymbolic-functions -Wl,-z,relro -Wa,--noexecstack -Wall -DMD32_REG_T=int -

DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -

DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -

DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM

OPENSSLDIR: "/usr/lib/ssl"

OPENSSLDIR . /usr/lib/ssl.

CSR OpenSSL, Apache, apache2.conf httpd.conf. SSLCertficateKeyFile .

Windows (IIS)

, Windows Internet Information Services, , Windows .

, .pfx, . :

  1. MMC (Microsoft Management Console).
  2. ( ), .
  3. , -. Common name ()
  4. , , -> .
  5. .pfx.

, , Windows.

, Windows (, Apache), .pfx .key .crt .cer. OpenSSL.

SSL- Windows , Windows?

Windows , Windows, .pfx OpenSSL.

  1. .pfx, , OpenSSL, :
    openssl pkcs12 -in mypfxfile.pfx -out privatekey.txt nodes
    mypfxfile.pfx- Windows.
  2. privatekey.txt. , , :
    -----BEGIN RSA PRIVATE KEY-----
    (Encrypted Text Block)
    -----END RSA PRIVATE KEY-----
    		
  3. , BEGIN END, . Your_Domain_Name.key.

OpenSSL CSR

Apache, (CSR) PEM. , CSR Tomcat Windows IIS? PEM PFX. .

: -nodes, .key. , .

PEM CSR PKCS12 (.pfx .p12)

FKCS12 Windows IIS.

openssl pkcs12 -inkey domain.key -in domain.crt -export -out domain.pfx

CSR .pfx. -, . , , PEM, .pfx.

PKCS12 PEM CSR

openssl pkcs12 -in domain.pfx -nodes -out domain.combined.crt

.pfx , .crt PEM .

PEM DER

DER - , Java. ASCII PEM DER, OpenSSL:

openssl x509 -in domain.crt -outform der -out domain.der

DER PEM

.der PEM, OpenSSL:

openssl x509 -inform der -in domain.der -out domain.crt

OpenSSL .

openssl rsa -des3 -in unencrypted.key -out encrypted.key

.


OpenSSL .

openssl rsa -in encrypted.key -out decrypted.key

.


OpenSSL

OpenSSL, , :

openssl version -a

:

OpenSSL 1.0.1f 6 Jan 2014
built on: Mon Apr  7 21:22:23 UTC 2014
platform: debian-amd64
options:  bn(64,64) rc4(16x,int) des(idx,cisc,16,int) blowfish(idx)
compiler: cc -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wa,--noexecstack -Wall -DMD32_REG_T=int -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM
OPENSSLDIR: "/usr/lib/ssl"

, OpenSSL, .


50% Merion Academy