SNI not set
jkransen opened this issue · comments
Jeroen Kransen commented
This is the code I use to connect to a remote server:
val postUrl = "https://api.luftdaten.info/v1/push-sensor-data/"
val response = Http(postUrl).headers(Seq("X-PIN" -> "1", "X-Sensor" -> s"fijnstof-${report.id}")).postForm(Seq("P1" -> report.pm10.toString, "P2" -> report.pm25.toString)).option(HttpOptions.allowUnsafeSSL).asString
log.debug(s"Luftdaten: $response")
The response I get is a 403 Forbidden with:
Reason: The client software did not provide a hostname using Server Name Indication (SNI), which is required to access this server.`
I tried setting System.setProperty("jsse.enableSNIExtension", "true")
, even though the underlying java.net.HttpsURLConnection is said to default to true.
Is this a bug, or am I missing something?
Jon Hoffman commented
I think using HttpOptions.allowUnsafeSSL is related to this.
Are you using that because you're getting cert chain errors without it? I
know that some JVMs ship without Let's Encrypt root certs
…On Fri, Jun 15, 2018 at 12:33 PM Jeroen Kransen ***@***.***> wrote:
This is the code I use to connect to a remote server:
val postUrl = "https://api.luftdaten.info/v1/push-sensor-data/" val
response = Http(postUrl).headers(Seq("X-PIN" -> "1", "X-Sensor" ->
s"fijnstof-${report.id}")).postForm(Seq("P1" -> report.pm10.toString,
"P2" -> report.pm25.toString)).option(HttpOptions.allowUnsafeSSL).asString
log.debug(s"Luftdaten: $response")
The response I get is a 403 Forbidden with:
Reason: The client software did not provide a hostname using Server Name
Indication (SNI), which is required to access this server.
I tried setting System.setProperty("jsse.enableSNIExtension", "true"),
even though the underlying java.net.HttpsURLConnection is said to default
to true.
Is this a bug, or am I missing something?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#168>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfWCjynMiXUxDREpwVjs113uJ3ZzFQks5t8-HngaJpZM4Up1xf>
.