ssl配置

apache

证书文件: xx_public.key
证书链文件:xx.chain.crt
秘钥文件: xx.key

    vim httpd.conf #需安装ssl模块,yum安装为mod_ssl,源码安装需编译。 
    LoadModule ssl_module modules/mod_ssl.so   
    Include conf/extra/httpd-ssl.conf
   
    vim httpd-ssl.conf
    SSLProtocol all -SSLv2 -SSLv3    
    SSLCipherSuite HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM    
    SSLHonorCipherOrder on
    SSLCertificateFile xx_public.key   
    SSLCertificateKeyFile xx.key    
    SSLCertificateChainFile xx.chain.crt
    
    #检测配置信息后重启
    apache configtest
    apache -k stop
    apache -k start

nginx

证书文件:xx.pem
秘钥文件:xx.key

    vim nginx.conf
    server {
    listen 443;
    server_name xx;  
    ssl on;  
    root html;
    index index.html index.htm;
    ssl_certificate xx.pem;   
    ssl_certificate_key xx.key;  
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; 
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;   
    ssl_prefer_server_ciphers on;   
    location / {
    root html;  
    index index.html index.htm;  
      }
    }
  
    nginx -t 
    nginx -s reload

tomcat

证书文件:xx.pfx
密码文件:xx.txt

    vim server.xml
    
  
    #HTTP 自动跳转 HTTPS 的安全配置
    vim  web.xml
    
   
   CLIENT-CERT
   Client Cert Users-only Area
   
   
   
   
   SSL
   /*
   
   
   CONFIDENTIAL
   
   

  vim server.xml
  

  #重启tomcat
pfx转为jks格式证书
  keytool -importkeystore -srckeystore domain name.pfx -destkeystore domain name.jks -srcstoretype PKCS12 -deststoretype JKS

输入PFX证书密码和JKS证书密码。

你可能感兴趣的:(ssl配置)