Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个服务器应用程序,只有一行
Certificate[] certs = sslSocket.getSession().getPeerCertificates();
这需要大约 5 秒才能完成。有没有办法让工作更快?
如果套接字上没有进行任何 I/O,getSession() 将启动 SSL 握手,这可能需要很长时间。您正在与对等方进行通信。如果 I/O 已经在套接字上完成,它会工作得更快,但是当然成本只是转移到第一个 I/O 调用上。