diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Web/OpenWeatherMap/Client.hs | 10 |
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" |