JDK-8224990 : Tag mismatch, javax/net/ssl/ServerName/SSLEngineExplorerMatchedSNI.java
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.net.ssl
  • Affected Version: 13
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2019-05-29
  • Updated: 2019-05-29
  • Resolved: 2019-05-29
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Test failure:

command: main SSLEngineExplorerMatchedSNI www.us.example.com (.*\\.)*example\\.(com|org)
reason: User specified action: run main/othervm SSLEngineExplorerMatchedSNI www.us.example.com (.*\\.)*example\\.(com|org) 
Mode: othervm [/othervm specified]
elapsed time (seconds): 0.983
----------configuration:(0/0)----------
----------System.out:(9/476)----------
resize destination buffer upto 16709 bytes for BUFFER_OVERFLOW
resize source buffer upto 16709 bytes for BUFFER_UNDERFLOW
Record version: TLSv1.2
Hello version: TLSv1.2
resize destination buffer upto 16709 bytes for BUFFER_OVERFLOW
resize destination buffer upto 16709 bytes for BUFFER_OVERFLOW
resize source buffer upto 16709 bytes for BUFFER_UNDERFLOW
resize destination buffer upto 16676 bytes for BUFFER_OVERFLOW
resize source buffer upto 16709 bytes for BUFFER_UNDERFLOW
----------System.err:(42/3038)----------
javax.net.ssl.SSLException: Tag mismatch!
	at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:133)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:320)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:263)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:258)
	at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:129)
	at java.base/sun.security.ssl.SSLEngineImpl.decode(SSLEngineImpl.java:700)
	at java.base/sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:655)
	at java.base/sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:470)
	at java.base/sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:446)
	at java.base/javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:634)
	at SSLEngineService.receive(SSLEngineService.java:167)
	at SSLEngineExplorerMatchedSNI.doServerSide(SSLEngineExplorerMatchedSNI.java:160)
	at SSLEngineExplorerMatchedSNI.startServer(SSLEngineExplorerMatchedSNI.java:369)
	at SSLEngineExplorerMatchedSNI.<init>(SSLEngineExplorerMatchedSNI.java:319)
	at SSLEngineExplorerMatchedSNI.main(SSLEngineExplorerMatchedSNI.java:300)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: javax.crypto.AEADBadTagException: Tag mismatch!
	at java.base/com.sun.crypto.provider.GaloisCounterMode.decryptFinal(GaloisCounterMode.java:623)
	at java.base/com.sun.crypto.provider.CipherCore.finalNoPadding(CipherCore.java:1116)
	at java.base/com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:1053)
	at java.base/com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:941)
	at java.base/com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:491)
	at java.base/javax.crypto.CipherSpi.bufferCrypt(CipherSpi.java:779)
	at java.base/javax.crypto.CipherSpi.engineDoFinal(CipherSpi.java:730)
	at java.base/javax.crypto.Cipher.doFinal(Cipher.java:2503)
	at java.base/sun.security.ssl.SSLCipher$T13GcmReadCipherGenerator$GcmReadCipher.decrypt(SSLCipher.java:1930)
	at java.base/sun.security.ssl.SSLEngineInputRecord.decodeInputRecord(SSLEngineInputRecord.java:240)
	at java.base/sun.security.ssl.SSLEngineInputRecord.decode(SSLEngineInputRecord.java:197)
	at java.base/sun.security.ssl.SSLEngineInputRecord.decode(SSLEngineInputRecord.java:160)
	at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:108)
	... 16 more

Comments
This looks very much like JDK-8212096
29-05-2019