为了支持 SSL/TLS, Java 提供了 javax.net.ssl 包,它的 SSLContext 和 SSLEngine 类使得实现解密和加密相当简单直接。 Netty 通过一个名为 SslHandler 的 ChannelHandler 实现利用了这个 API, 其中 SslHandler 在内部使用 SSLEngine 来完成实际的工作。 SSLEngine sslEngine = context.newEngine(byteBufAllocator); //服务器端模式,客户端模式设置为true sslEngine.setUseClientMode(false); //不需要验证客户端,客户端不设置该项 sslEngine.setNeedClientAuth(false sslEngine = sslContext.newEngine(ch.alloc()); if (isClient) { //使用 HTTPS,添加 SSL
mod_ssl.so Listen 443 <VirtualHost *:443> DocumentRoot "/var/www/html" ServerName domaintest.cn SSLEngine VirtualHost> 配置文件参数 说明 LoadModule 加载SSL模块 Listen 监听443端口 DocumentRoot 网页目录 ServerName 站点域名 SSLEngine NameVirtualHost *:443 # 第一个虚拟主机 <VirtualHost *:443> DocumentRoot "/var/www/html" ServerName domaintest.cn SSLEngine VirtualHost> #第二个虚拟主机 <VirtualHost *:443> DocumentRoot "/var/www/html" ServerName web.domaintest.cn SSLEngine
etc/apache2/mods-enabled/ 里查看 这里直接上本人的配置: <VirtualHost *:443> ServerName facebook.smarthippo.club SSLEngine https://www.facebook.com/ </VirtualHost> <VirtualHost *:443> ServerName google.smarthippo.club SSLEngine
如果不想启用SSL,将server.xml中apr模式下ssl关闭即可: <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine ="on" /> 将SSLEngine的值从on改成off即可: <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="off" /> 其他 Tomcat 6.x版本从6.0.32开始就默认支持apr。
$ sudo vim /etc/apache2/sites-enabled/default-ssl.conf ServerName extend.me 5、配置SSL证书 按如下配置: SSLEngine ca.crt SSLCertificateKeyFile /etc/apache2/ssl/server.key 重新启动Apache $ sudo service apache2 restart SSLEngine
443端口 再参考官方文档的一段内容: Listen 443 <VirtualHost *:443> DocumentRoot "项目入口文件目录" ServerName 域名 SSLEngine 端的调试工具和IOS以及其他浏览器上未发现该问题 解决方法:修改虚拟机配置如下: ` Listen 443 DocumentRoot “项目入口文件目录” ServerName 域名 SSLEngine
看下日志,报的是未连接Node Manager,还有一些General SSLEngine problem的错误, ...... Connecting to Node Manager ... This Exception occurred at Thu Jul 13 14:33:03 CST 2017. javax.net.ssl.SSLHandshakeException: General SSLEngine of Exception: Error occured while performing nmConnect : Cannot connect to Node Manager. : General SSLEngine of Exception: Error occured while performing nmConnect : Cannot connect to Node Manager. : General SSLEngine
Listen 443<VirtualHost *:443> DocumentRoot "这里改为你项目的绝对路径" ServerName 这里改为你要配置的域名 ServerAlias 这里改为你要配置的域名 SSLEngine VirtualHost><VirtualHost *:443> DocumentRoot "这里改为你项目的绝对路径 ServerName 这里改为你要配置的域名 ServerAlias 这里改为你要配置的域名 SSLEngine
SSLCertificateChainFile /root/.acme.sh/blog.xihefeng.com/fullchain.cer <IfModule mod_ssl.c> <VirtualHost *:443> SSLEngine
:443 <VirtualHost 172.16.1.117:443> DocumentRoot /var/www/html ServerName www2.jnds.net SSLEngine
org.apache.catalina.startup.VersionLoggerListener" /> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine org.apache.catalina.startup.VersionLoggerListener" /> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine
cp server.key /etc/ssl/private 2、编辑ssl配置文件 vim /etc/httpd/conf.d/ssl.conf SSLEngine
server.crt和server.key 二:打开httpd-ahssl.conf(在httpd.conf同级目录下的extra文件夹中),修改如下: <VirtualHost _default_:443> SSLEngine
org.apache.catalina.startup.VersionLoggerListener" /> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine org.apache.catalina.startup.VersionLoggerListener" /> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine
public void checkClientTrusted( X509Certificate[] x509Certificates, String s, SSLEngine sslEngine) throws CertificateException {} @Override public void checkServerTrusted( X509Certificate[] x509Certificates, String s, SSLEngine sslEngine
ssl/ 上传证书到此目录下 4.编辑修改ssl配置文件 DocumentRoot "/var/www/html" #网页文件路径 ServerName 域名:443 #改为自己的域名 SSLEngine
www.chinaskills.cn Documentroot /webdata/wordpress <Directory /webdata/wordpress> require all granted </Directory> sslengine Indexes authname "download" authtype basic authuserfile "/var/passwd" require valid-user </Directory> sslengine
VirtualHost _default_:443> DocumentRoot "/FILE/WEB/www" //你的网站文件目录 ServerName localhost:443 SSLEngine
/ssl.conf 5) 修改以下几行,去掉前面的“#”注释; DocumentRoot "/var/www/html" #网页文件路径 ServerName 域名:443 #改为自己的域名 SSLEngine
要点介绍 SslContext 官方介绍:https://netty.io/4.1/api/io/netty/handler/ssl/SslContext.html 公共抽象类,安全套接字协议实现充当工厂SSLEngine 256")); public static void main(String[] args) throws Exception { //公共抽象类,安全套接字协议实现充当工厂SSLEngine