directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fratre <fra...@gmail.com>
Subject Re: [mina] Anyone who can help me testing StartTLS and TLS closure?
Date Thu, 27 Oct 2005 02:25:05 GMT
Trustin,

cpu:  dual P4 2.8
mem:  1G
os:   Windows 2003
ide: eclipse
jvm: jdk1.5.0.05

I modified the main function:
    public static void main( String[] args )
    {
    	for(int i=1;i<1000;i++){
    		System.out.println("Loop times:"+i);
    		junit.textui.TestRunner.run( ConnectorTest.class );
    	}
    }



The messages of  console output such as follow:
The first time:
Loop times:1
.Using port 1 for testing.
Using port 2 as local address
* Without localAddress and initializer
log4j:WARN No appenders could be found for logger (org.apache.mina.examples.echoserver.EchoProtocolHandler).
log4j:WARN Please initialize the log4j system properly.
* Without localAddress and with initializer
** Skipping some tests that fails in Windows platform.
.Using port 1 for testing.
Using port 2 as local address
* Without localAddress and initializer
* Without localAddress and with initializer
** Skipping some tests that fails in Windows platform.
.Using port 1 for testing.
Using port 2 as local address
* Without localAddress and initializer
* Without localAddress and with initializer
** Skipping some tests that fails in Windows platform.

Time: 1.687

OK (3 tests)
......

Time: 0.755

OK (3 tests)

Loop times:20
.Using port 1 for testing.
Using port 2 as local address
* Without localAddress and initializer
* Without localAddress and with initializer
** Skipping some tests that fails in Windows platform.
.Using port 1 for testing.
Using port 2 as local address
* Without localAddress and initializer
* Without localAddress and with initializer
javax.net.ssl.SSLHandshakeException: Initial SSL handshake failed.
	at org.apache.mina.filter.SSLFilter.messageReceived(SSLFilter.java:306)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$5(AbstractIoFilterChain.java:485)
	at org.apache.mina.common.support.AbstractIoFilterChain$Entry$1.messageReceived(AbstractIoFilterChain.java:684)
	at org.apache.mina.common.support.AbstractIoFilterChain$1.messageReceived(AbstractIoFilterChain.java:118)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.messageReceived(AbstractIoFilterChain.java:482)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.read(SocketIoProcessor.java:283)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.processSessions(SocketIoProcessor.java:238)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.access$2(SocketIoProcessor.java:227)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor$Worker.run(SocketIoProcessor.java:545)
Caused by: javax.net.ssl.SSLException: SSLEngine error during decrypt: BUFFER_OVERFLOW inNetBuffer:
java.nio.DirectByteBuffer[pos=0 lim=16665 cap=16665]appBuffer: java.nio.DirectByteBuffer[pos=0
lim=33330 cap=33330]
	at org.apache.mina.filter.support.SSLHandler.checkStatus(SSLHandler.java:351)
	at org.apache.mina.filter.support.SSLHandler.unwrapHandshake(SSLHandler.java:687)
	at org.apache.mina.filter.support.SSLHandler.doHandshake(SSLHandler.java:445)
	at org.apache.mina.filter.support.SSLHandler.messageReceived(SSLHandler.java:240)
	at org.apache.mina.filter.SSLFilter.messageReceived(SSLFilter.java:287)
	... 10 more
javax.net.ssl.SSLException: Unsupported record version Unknown-30.252
	at com.sun.net.ssl.internal.ssl.EngineInputRecord.bytesInCompletePacket(EngineInputRecord.java:97)
	at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:759)
	at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:674)
	at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:566)
	at org.apache.mina.filter.support.SSLHandler.unwrap(SSLHandler.java:585)
	at org.apache.mina.filter.support.SSLHandler.doDecrypt(SSLHandler.java:338)
	at org.apache.mina.filter.support.SSLHandler.messageReceived(SSLHandler.java:244)
	at org.apache.mina.filter.SSLFilter.messageReceived(SSLFilter.java:287)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$5(AbstractIoFilterChain.java:485)
	at org.apache.mina.common.support.AbstractIoFilterChain$Entry$1.messageReceived(AbstractIoFilterChain.java:684)
	at org.apache.mina.common.support.AbstractIoFilterChain$1.messageReceived(AbstractIoFilterChain.java:118)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.messageReceived(AbstractIoFilterChain.java:482)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.read(SocketIoProcessor.java:283)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.processSessions(SocketIoProcessor.java:238)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.access$2(SocketIoProcessor.java:227)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor$Worker.run(SocketIoProcessor.java:545)
java.lang.IllegalStateException
	at org.apache.mina.filter.support.SSLHandler.doDecrypt(SSLHandler.java:335)
	at org.apache.mina.filter.support.SSLHandler.messageReceived(SSLHandler.java:244)
	at org.apache.mina.filter.SSLFilter.messageReceived(SSLFilter.java:287)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$5(AbstractIoFilterChain.java:485)
	at org.apache.mina.common.support.AbstractIoFilterChain$Entry$1.messageReceived(AbstractIoFilterChain.java:684)
	at org.apache.mina.common.support.AbstractIoFilterChain$1.messageReceived(AbstractIoFilterChain.java:118)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.messageReceived(AbstractIoFilterChain.java:482)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.read(SocketIoProcessor.java:283)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.processSessions(SocketIoProcessor.java:238)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.access$2(SocketIoProcessor.java:227)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor$Worker.run(SocketIoProcessor.java:545)

I terminate the project, run it again:
Loop times:1
.Using port 1 for testing.
Using port 2 as local address
* Without localAddress and initializer
log4j:WARN No appenders could be found for logger (org.apache.mina.examples.echoserver.EchoProtocolHandler).
log4j:WARN Please initialize the log4j system properly.
* Without localAddress and with initializer
** Skipping some tests that fails in Windows platform.
.Using port 1 for testing.
Using port 2 as local address
* Without localAddress and initializer
* Without localAddress and with initializer
** Skipping some tests that fails in Windows platform.
.Using port 1 for testing.
Using port 2 as local address
* Without localAddress and initializer
* Without localAddress and with initializer
** Skipping some tests that fails in Windows platform.

Time: 1.641

OK (3 tests)
 ......

Time: 0.797

OK (3 tests)

Loop times:63
.Using port 1 for testing.
Using port 2 as local address
* Without localAddress and initializer
* Without localAddress and with initializer
** Skipping some tests that fails in Windows platform.
.Using port 1 for testing.
Using port 2 as local address
* Without localAddress and initializer
javax.net.ssl.SSLHandshakeException: Initial SSL handshake failed.
	at org.apache.mina.filter.SSLFilter.messageReceived(SSLFilter.java:306)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$5(AbstractIoFilterChain.java:485)
	at org.apache.mina.common.support.AbstractIoFilterChain$Entry$1.messageReceived(AbstractIoFilterChain.java:684)
	at org.apache.mina.common.support.AbstractIoFilterChain$1.messageReceived(AbstractIoFilterChain.java:118)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.messageReceived(AbstractIoFilterChain.java:482)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.read(SocketIoProcessor.java:283)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.processSessions(SocketIoProcessor.java:238)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.access$2(SocketIoProcessor.java:227)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor$Worker.run(SocketIoProcessor.java:545)
Caused by: javax.net.ssl.SSLException: SSLEngine error during decrypt: BUFFER_OVERFLOW inNetBuffer:
java.nio.DirectByteBuffer[pos=0 lim=16665 cap=16665]appBuffer: java.nio.DirectByteBuffer[pos=0
lim=33330 cap=33330]
	at org.apache.mina.filter.support.SSLHandler.checkStatus(SSLHandler.java:351)
	at org.apache.mina.filter.support.SSLHandler.unwrapHandshake(SSLHandler.java:687)
	at org.apache.mina.filter.support.SSLHandler.doHandshake(SSLHandler.java:445)
	at org.apache.mina.filter.support.SSLHandler.messageReceived(SSLHandler.java:240)
	at org.apache.mina.filter.SSLFilter.messageReceived(SSLFilter.java:287)
	... 10 more
java.nio.BufferOverflowException
	at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:279)
	at org.apache.mina.common.ByteBuffer$DefaultByteBuffer.put(ByteBuffer.java:776)
	at org.apache.mina.examples.echoserver.ConnectorTest$EchoConnectorHandler.messageReceived(ConnectorTest.java:209)
	at org.apache.mina.common.support.AbstractIoFilterChain$2.messageReceived(AbstractIoFilterChain.java:204)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$5(AbstractIoFilterChain.java:485)
	at org.apache.mina.common.support.AbstractIoFilterChain$Entry$1.messageReceived(AbstractIoFilterChain.java:684)
	at org.apache.mina.common.support.AbstractIoFilterChain$1.messageReceived(AbstractIoFilterChain.java:118)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.messageReceived(AbstractIoFilterChain.java:482)
	at org.apache.mina.common.support.IoSessionManagerFilterChain$1.messageReceived(IoSessionManagerFilterChain.java:92)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$5(AbstractIoFilterChain.java:485)
	at org.apache.mina.common.support.AbstractIoFilterChain$Entry$1.messageReceived(AbstractIoFilterChain.java:684)
	at org.apache.mina.filter.SSLFilter.handleAppDataRead(SSLFilter.java:491)
	at org.apache.mina.filter.SSLFilter.handleSSLData(SSLFilter.java:473)
	at org.apache.mina.filter.SSLFilter.messageReceived(SSLFilter.java:290)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$5(AbstractIoFilterChain.java:485)
	at org.apache.mina.common.support.AbstractIoFilterChain$Entry$1.messageReceived(AbstractIoFilterChain.java:684)
	at org.apache.mina.common.support.AbstractIoFilterChain$1.messageReceived(AbstractIoFilterChain.java:118)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.messageReceived(AbstractIoFilterChain.java:482)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.read(SocketIoProcessor.java:283)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.processSessions(SocketIoProcessor.java:238)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.access$2(SocketIoProcessor.java:227)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor$Worker.run(SocketIoProcessor.java:545)
java.nio.BufferOverflowException
	at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:279)
	at org.apache.mina.common.ByteBuffer$DefaultByteBuffer.put(ByteBuffer.java:776)
	at org.apache.mina.examples.echoserver.ConnectorTest$EchoConnectorHandler.messageReceived(ConnectorTest.java:209)
	at org.apache.mina.common.support.AbstractIoFilterChain$2.messageReceived(AbstractIoFilterChain.java:204)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$5(AbstractIoFilterChain.java:485)
	at org.apache.mina.common.support.AbstractIoFilterChain$Entry$1.messageReceived(AbstractIoFilterChain.java:684)
	at org.apache.mina.common.support.AbstractIoFilterChain$1.messageReceived(AbstractIoFilterChain.java:118)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.messageReceived(AbstractIoFilterChain.java:482)
	at org.apache.mina.common.support.IoSessionManagerFilterChain$1.messageReceived(IoSessionManagerFilterChain.java:92)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$5(AbstractIoFilterChain.java:485)
	at org.apache.mina.common.support.AbstractIoFilterChain$Entry$1.messageReceived(AbstractIoFilterChain.java:684)
	at org.apache.mina.filter.SSLFilter.handleAppDataRead(SSLFilter.java:491)
	at org.apache.mina.filter.SSLFilter.handleSSLData(SSLFilter.java:473)
	at org.apache.mina.filter.SSLFilter.messageReceived(SSLFilter.java:290)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$5(AbstractIoFilterChain.java:485)
	at org.apache.mina.common.support.AbstractIoFilterChain$Entry$1.messageReceived(AbstractIoFilterChain.java:684)
	at org.apache.mina.common.support.AbstractIoFilterChain$1.messageReceived(AbstractIoFilterChain.java:118)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.messageReceived(AbstractIoFilterChain.java:482)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.read(SocketIoProcessor.java:283)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.processSessions(SocketIoProcessor.java:238)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.access$2(SocketIoProcessor.java:227)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor$Worker.run(SocketIoProcessor.java:545)
javax.net.ssl.SSLException: Received fatal alert: bad_record_mac
	at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:166)
	at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1352)
	at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1320)
	at com.sun.net.ssl.internal.ssl.SSLEngineImpl.recvAlert(SSLEngineImpl.java:1482)
	at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:957)
	at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:782)
	at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:674)
	at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:566)
	at org.apache.mina.filter.support.SSLHandler.unwrap(SSLHandler.java:585)
	at org.apache.mina.filter.support.SSLHandler.doDecrypt(SSLHandler.java:338)
	at org.apache.mina.filter.support.SSLHandler.messageReceived(SSLHandler.java:244)
	at org.apache.mina.filter.SSLFilter.messageReceived(SSLFilter.java:287)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$5(AbstractIoFilterChain.java:485)
	at org.apache.mina.common.support.AbstractIoFilterChain$Entry$1.messageReceived(AbstractIoFilterChain.java:684)
	at org.apache.mina.common.support.AbstractIoFilterChain$1.messageReceived(AbstractIoFilterChain.java:118)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:491)
	at org.apache.mina.common.support.AbstractIoFilterChain.messageReceived(AbstractIoFilterChain.java:482)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.read(SocketIoProcessor.java:283)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.processSessions(SocketIoProcessor.java:238)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor.access$2(SocketIoProcessor.java:227)
	at org.apache.mina.transport.socket.nio.support.SocketIoProcessor$Worker.run(SocketIoProcessor.java:545)


ps. I run the test 5 times again, the max loop times is 145.

-- 
fratre <fratre@gmail.com>


Mime
View raw message