mirror of
https://github.com/square/okhttp.git
synced 2025-08-07 12:42:57 +03:00
Avoid InetAddress.getCanonicalHostName(). (#7607)
Just hard-coding 'localhost' is simpler and avoids problems where the host machine's IP address has additional DNS registrations. Closes: https://github.com/square/okhttp/issues/7603
This commit is contained in:
@@ -367,7 +367,7 @@ open class PlatformRule @JvmOverloads constructor(
|
||||
private val localhostHandshakeCertificatesWithRsa2048: HandshakeCertificates by lazy {
|
||||
val heldCertificate = HeldCertificate.Builder()
|
||||
.commonName("localhost")
|
||||
.addSubjectAlternativeName(InetAddress.getByName("localhost").canonicalHostName)
|
||||
.addSubjectAlternativeName("localhost")
|
||||
.rsa2048()
|
||||
.build()
|
||||
return@lazy HandshakeCertificates.Builder()
|
||||
|
Reference in New Issue
Block a user