diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2023-01-05 13:53:50 +0200 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2023-01-05 13:54:29 +0200 |
commit | d7e06953eb8fa61c01ac4e1ec93e58af4eeb524a (patch) | |
tree | c8a55d26acb24479bafc5a628213aa30b73b8da2 | |
parent | d625bb9213bc78730f98c556d59813b444235fc4 (diff) | |
download | openweathermap-d7e06953eb8fa61c01ac4e1ec93e58af4eeb524a.tar.gz |
Switch to HTTPS
-rw-r--r-- | lib/Web/OpenWeatherMap/Client.hs | 10 | ||||
-rw-r--r-- | openweathermap.cabal | 2 |
2 files changed, 5 insertions, 7 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" diff --git a/openweathermap.cabal b/openweathermap.cabal index 6dbdfe8..d3ba84e 100644 --- a/openweathermap.cabal +++ b/openweathermap.cabal @@ -49,7 +49,7 @@ library aeson -any, bytestring -any, http-api-data -any, - http-client -any, + http-client-tls -any, servant -any, servant-client >=0.19, servant-client-core -any, |