Skip to content

Commit

Permalink
Merge pull request #1813
Browse files Browse the repository at this point in the history
* OSM Tileserver now supports TLSv1.3, so we should use this in prefere…
  • Loading branch information
poggs authored Jan 30, 2024
1 parent 5222bff commit c047d48
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,7 @@ private byte[] cacheInputStream(URL url) throws IOException

try
{
//Java 13 uses TLSv1.3 by default and fails to connect to tile server, so force TLS 1.2
SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
SSLContext sslContext = SSLContext.getInstance("TLSv1.3");
sslContext.init(null, null, new SecureRandom());
conn.setSSLSocketFactory(sslContext.getSocketFactory());
}
Expand All @@ -427,7 +426,7 @@ private byte[] cacheInputStream(URL url) throws IOException
}
catch(NoSuchAlgorithmException nsae)
{
mLog.error("Unable to use TLSv1.2 for openstreetmap tiles");
mLog.error("Unable to use TLSv1.3 for OpenStreetMap tiles");
}

InputStream is = conn.getInputStream();
Expand Down

0 comments on commit c047d48

Please sign in to comment.