首页 > 解决方案 > 在服务器端获取 HTTPS 协议

问题描述

我们正在尝试获取客户端对我们服务的请求中使用的 HTTPS 协议(SSLv3、TLS 1.0、TLS 1.1、TLS 1.2),我们需要对其进行跟踪。

我们知道如何从 Java 客户端(后面的示例)获取它,但我们想从服务器端恢复,有什么办法吗?

public String getProtocol(){
   String protocol = "";

   if(s != null){
       try{
           SSLSession session = ((SSLSocket) s).getSession();
           protocol = session.getProtocol();
       }
       catch(Exception e){
           log.error("Error: ",e);
       }
   }

   return protocol 
}

标签: javahttpsserver

解决方案


推荐阅读