开发者社区 问答 正文

tomcat实现https过程的加密算法能修改么?

了解还不够深入,可能问题本身就存在问题。
看网上介绍SSL,一般是通过非对称加密传递一个对称密钥,剩下的通信过程使用这个对称密钥进行加密。
tomcat实现https的过程不知道是不是也是这样:通过证书加密通信过程,传递一个对称密钥,然后利用这个对称密钥进行通信?
如果是这样那么最后那个加密过程是在哪个源码文件中实现的?
请熟悉这方面的大牛赐教,目的就是想修改https实现过程中的加密过程。
在源码中找到这么一个文件夹
1
不知道里面的文件都是什么作用?
还有JIoEndpoint.java文件中找到下面的代码:

/**
     * Set the options for the current socket.
     */
    protected boolean setSocketOptions(Socket socket) {
        // Process the connection
        int step = 1;
        try {
 
            // 1: Set socket options: timeout, linger, etc
            if (soLinger >= 0) { 
                socket.setSoLinger(true, soLinger);
            }
            if (tcpNoDelay) {
                socket.setTcpNoDelay(tcpNoDelay);
            }
            if (soTimeout > 0) {
                socket.setSoTimeout(soTimeout);
            }
 
            // 2: SSL handshake
            step = 2;
            serverSocketFactory.handshake(socket);
 
        } catch (Throwable t) {
            if (log.isDebugEnabled()) {
                if (step == 2) {
                    log.debug(sm.getString("endpoint.err.handshake"), t);
                } else {
                    log.debug(sm.getString("endpoint.err.unexpected"), t);
                }
            }
            // Tell to close the socket
            return false;
        }
        return true;
    }

但是针对handshake函数相应的找到

/**
       Extra function to initiate the handshake. Sometimes necessary
       for SSL
  
       <a href="http://my.oschina.net/liangxuegao" class="referer" target="_blank">@exception</a>  IOException;
     */
     public abstract void handshake(Socket sock)
    throws IOException;

throws IOException;是没有函数实现还是什么意思?
网上倒是很多介绍tomcat处理http请求分析的,却没找到处理https请求分析的。

展开
收起
落地花开啦 2016-03-25 11:17:12 2398 分享 版权
0 条回答
写回答
取消 提交回答