java - 在服务器端获取 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
}
解决方案
推荐阅读
- javascript - 谷歌翻译 - 一次翻译整个页面
- php - 影响特定目录的 htaccess 路由
- sql - SQL 从满足预定义条件的表中选择成对组合
- python - 如何从 psycopg2 请求表大小?
- python - Python 3 类型既是对象又是类?
- arrays - 对于大于另一个 numpy 数组中指定的阈值的值,如何将 numpy 数组的元素设置为某些值(阈值)?
- c++ - 如何在 C++ 中将用户输入存储到数组中
- laravel - 控制器中的序列码问题
- android - Windows Batch - 通过变量传递空间以在 ADB 命令中使用
- scala - 尝试在 Scala 中编写通用过滤器函数