Skip to content
This repository was archived by the owner on Apr 4, 2022. It is now read-only.
This repository was archived by the owner on Apr 4, 2022. It is now read-only.

SNI not set #168

@jkransen

Description

@jkransen

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions