我正在尝试修复AEADBadTagException:标签不匹配来自第三方API(下面的堆栈跟踪)。我正在使用改装版本2.2.0
"javax.crypto.AEADBadTagException: Tag mismatch!",
"at c.s.c.p.GaloisCounterMode.decryptFinal(GaloisCounterMode.java:524)",
"at c.s.c.p.CipherCore.finalNoPadding(CipherCore.java:1023)",
"... 2 frames excluded",
"at javax.crypto.Cipher.doFinal(Cipher.java:2377)",
"at s.s.ssl.CipherBox.decrypt(CipherBox.java:461)",
"at s.s.ssl.InputRecord.decrypt(InputRecord.java:172)",
"at s.s.s.SSLSocketImpl.readRecord(SSLSocketImpl.java:1015)",
"... 90 common frames omitted",
"Wrapped by: j.n.ssl.SSLException: Tag mismatch!",
"at s.s.ssl.Alerts.getSSLException(Alerts.java:208)",
"at s.s.s.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)",
"at s.s.s.SSLSocketImpl.readRecord(SSLSocketImpl.java:1020)",
"at s.s.s.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:930)",
"at s.s.s.AppInputStream.read(AppInputStream.java:105)",
"at okio.Okio$2.read(Okio.java:138)",
"at okio.AsyncTimeout$2.read(AsyncTimeout.java:236)",
"at o.RealBufferedSource.request(RealBufferedSource.java:66)",
"at o.RealBufferedSource.require(RealBufferedSource.java:59)",
"at o.RealBufferedSource.readHexadecimalUnsignedLong(RealBufferedSource.java:284)",
"at o.i.h.Http1Codec$ChunkedSource.readChunkSize(Http1Codec.java:444)", "at o.i.h.Http1Codec$ChunkedSource.read(Http1Codec.java:425)",
"at o.RealBufferedSource.request(RealBufferedSource.java:66)",
"at o.l.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:238)",
"at o.i.h.RealInterceptorChain.proceed(RealInterceptorChain.java:92)", "at o.i.h.RealInterceptorChain.proceed(RealInterceptorChain.java:67)",
"at c.i.t.c.ClientConfiguration.lambda$irctcClient$48(ClientConfiguration.java:77)",
"at o.i.h.RealInterceptorChain.proceed(RealInterceptorChain.java:92)", "at o.i.h.RealInterceptorChain.proceed(RealInterceptorChain.java:67)",
"at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:179)",
"... 73 frames truncated"
通过堆栈跟踪和stackoverflow,似乎问题在于解析核心java库时与第三方的API响应,并且与改造和OkHttp无关。但是,在用弹簧支架模板替换改造时,这些例外已完全停止。似乎OkHttp / retrofit正在对响应进行一些硬性检查,默认情况下不会出现在休息模板中。
这背后的原因是什么?我在这里找不到配置吗?我已经尝试通过创建不验证证书链的trustManager创建不安全的okhttp客户端,但它也没用。
请指导我。