aboutsummaryrefslogtreecommitdiff
path: root/lib/Web
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2023-01-05 13:53:50 +0200
committerIgor Pashev <pashev.igor@gmail.com>2023-01-05 13:54:29 +0200
commitd7e06953eb8fa61c01ac4e1ec93e58af4eeb524a (patch)
treec8a55d26acb24479bafc5a628213aa30b73b8da2 /lib/Web
parentd625bb9213bc78730f98c556d59813b444235fc4 (diff)
downloadopenweathermap-d7e06953eb8fa61c01ac4e1ec93e58af4eeb524a.tar.gz
Switch to HTTPS
Diffstat (limited to 'lib/Web')
-rw-r--r--lib/Web/OpenWeatherMap/Client.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Web/OpenWeatherMap/Client.hs b/lib/Web/OpenWeatherMap/Client.hs
index 31719bb..d9fdb18 100644
--- a/lib/Web/OpenWeatherMap/Client.hs
+++ b/lib/Web/OpenWeatherMap/Client.hs
@@ -6,12 +6,12 @@ module Web.OpenWeatherMap.Client
, getForecast
) where
-import Network.HTTP.Client (defaultManagerSettings, newManager)
+import Network.HTTP.Client.TLS (newTlsManager)
import Servant.Client
( BaseUrl(BaseUrl)
, ClientEnv
, ClientError
- , Scheme(Http)
+ , Scheme(Https)
, mkClientEnv
, runClientM
)
@@ -40,10 +40,8 @@ getForecast appid loc =
defaultEnv :: IO ClientEnv
defaultEnv = do
- manager <- newManager defaultManagerSettings
+ manager <- newTlsManager
return $ mkClientEnv manager baseUrl
--- XXX openweathermap.org does not support HTTPS,
--- XXX appid is passed in clear text. Oops.
baseUrl :: BaseUrl
-baseUrl = BaseUrl Http "api.openweathermap.org" 80 "/data/2.5"
+baseUrl = BaseUrl Https "api.openweathermap.org" 443 "/data/2.5"