Fabric で次の例外が発生しました。
Non-fatal Exception: javax.net.ssl.SSLPeerUnverifiedException: Hostname assets.domain.com not verified:
certificate: sha256/6NEXAaHJ2CAMKUOkWhMCwH9biv2QtAFsYMl0WqkocgM=
DN: CN=apc.aptilo.com,OU=Domain Control Validated - RapidSSL(R),OU=See www.rapidssl.com/resources/cps (c)13,OU=GT19785026,2.5.4.5=#13204456444273427335456d62337a6151706e6e6d356744615556354b6a63696c44
subjectAltNames: [apc.aptilo.com]
at okhttp3.internal.connection.RealConnection.connectTls(SourceFile:250)
at okhttp3.internal.connection.RealConnection.establishProtocol(SourceFile:198)
at okhttp3.internal.connection.RealConnection.buildConnection(SourceFile:174)
at okhttp3.internal.connection.RealConnection.connect(SourceFile:114)
at okhttp3.internal.connection.StreamAllocation.findConnection(SourceFile:193)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(SourceFile:129)
at okhttp3.internal.connection.StreamAllocation.newStream(SourceFile:98)
at okhttp3.internal.connection.ConnectInterceptor.intercept(SourceFile:42)
at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:67)
at okhttp3.internal.cache.CacheInterceptor.intercept(SourceFile:109)
at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:67)
at okhttp3.internal.http.BridgeInterceptor.intercept(SourceFile:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:92)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(SourceFile:124)
at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:67)
at okhttp3.RealCall.getResponseWithInterceptorChain(SourceFile:170)
at okhttp3.RealCall.access$100(SourceFile:33)
at okhttp3.RealCall$AsyncCall.execute(SourceFile:120)
at okhttp3.internal.NamedRunnable.run(SourceFile:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
セキュリティ チームと協力して、これはおそらく、ユーザーがホテルの Wi-Fi に接続されたアプリを開いて、それらの厄介なログイン ページでブランド化されたケースであることに気付きました。これまでのところ、影響を受けているのは 2 人のユーザーだけですが、さらに多くのユーザーがいるため、これが実際の中間者攻撃であるとは考えられません。
そのため、例外で共通名を検証したいと思います。それが私たちのホスト と一致する場合、assets.domain.com
攻撃の可能性があるので、その発生をログに記録したいと思います。CN が異なる場合は、エラーを抑制したいだけです。
私のオプションは何ですか?CN=value
例外原因文字列を解析し、正規表現でその部分を抽出することしか考えられません。しかし、エラーが発生しにくいより良い解決策はありますか?
tl;dr;
から CN 値を抽出し、SSLPeerUnverifiedException
有効なホスト名と比較したいと考えています。これを達成するための最良の方法は何ですか?