diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,23 @@
+2019-09-13  Vladimir Shabanov  <dev@vshabanov.com>
+
+	* HsOpenSSL.cabal (Version): Bump version to 0.11.4.17
+
+	* Allow old time, allows building with bundled time back to GHC-7.4
+	by Oleg Grenrus @phadej (#46)
+
 2019-01-21  Vladimir Shabanov  <dev@vshabanov.com>
 
+	* HsOpenSSL.cabal (Version):
+	Added upper version bounds to all dependencies (#41)
+
+2019-01-21  Vladimir Shabanov  <dev@vshabanov.com>
+
 	* HsOpenSSL.cabal (Version): Bump version to 0.11.4.16
 
 	* Compatibility for network-3.0.0
 	by Roman Borschel romanb (#40)
+
+	* .travis.yml: Fixed build. Updated to last 3 GHC versions.
 
 2018-09-08  Vladimir Shabanov  <dev@vshabanov.com>
 
diff --git a/HsOpenSSL.cabal b/HsOpenSSL.cabal
--- a/HsOpenSSL.cabal
+++ b/HsOpenSSL.cabal
@@ -12,7 +12,7 @@
     <http://hackage.haskell.org/package/tls>, which is a pure Haskell
     implementation of SSL.
     .
-Version:       0.11.4.16
+Version:       0.11.4.17
 License:       PublicDomain
 License-File:  COPYING
 Author:        Adam Langley, Mikhail Vorozhtsov, PHO, Taru Karttunen
@@ -23,7 +23,7 @@
 Category:      Cryptography
 Cabal-Version: 1.12
 Tested-With:
-    GHC==8.2.1, GHC==8.0.2, GHC==7.10.3
+    GHC==8.8.1, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC ==7.4.2
 Build-Type:    Custom
 Extra-Source-Files:
     AUTHORS
@@ -61,6 +61,11 @@
     Default:
         False
 
+flag old-locale
+  description: If true, use old-locale, otherwise use time 1.5 or newer.
+  manual:      False
+  default:     False
+
 Custom-setup
     setup-depends: Cabal >= 1.12,
                    base  >= 4.4 && < 5
@@ -68,10 +73,18 @@
 Library
     Build-Depends:
         base       >= 4.4 && < 5,
-        bytestring >= 0.9,
-        network    >= 2.1,
-        time       >= 1.5
+        bytestring >= 0.9 && < 0.11,
+        network    >= 2.1 && < 3.2,
+        time       >= 1.4 && < 1.10
 
+    if flag(old-locale)
+      build-depends:
+          old-locale  >=1.0.0.2 && <1.1
+        , time        >=0       && <1.5
+
+    else
+      build-depends: time >=1.5
+
     Build-Tools: hsc2hs >= 0.67
 
     if flag(fast-bignum) && impl(ghc >= 7.10.1)
@@ -158,7 +171,7 @@
     Build-Depends:
         HsOpenSSL,
         base                 >= 4.4 && < 5,
-        bytestring           >= 0.9
+        bytestring           >= 0.9 && < 0.11
     Default-Language:
         Haskell2010
     GHC-Options:
@@ -183,7 +196,7 @@
     Build-Depends:
         HsOpenSSL,
         base                 >= 4.4 && < 5,
-        bytestring           >= 0.9
+        bytestring           >= 0.9 && < 0.11
     Default-Language:
         Haskell2010
     GHC-Options:
@@ -196,7 +209,7 @@
     Build-Depends:
         HsOpenSSL,
         base                 >= 4.4 && < 5,
-        bytestring           >= 0.9
+        bytestring           >= 0.9 && < 0.11
     Default-Language:
         Haskell2010
     GHC-Options:
diff --git a/OpenSSL/ASN1.hsc b/OpenSSL/ASN1.hsc
--- a/OpenSSL/ASN1.hsc
+++ b/OpenSSL/ASN1.hsc
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 {-# LANGUAGE EmptyDataDecls           #-}
 {-# LANGUAGE ForeignFunctionInterface #-}
 module OpenSSL.ASN1
@@ -29,6 +30,10 @@
 import           OpenSSL.BN
 import           OpenSSL.Utils
 
+#if !MIN_VERSION_time(1,5,0)
+import System.Locale
+#endif
+
 {- ASN1_OBJECT --------------------------------------------------------------- -}
 
 data ASN1_OBJECT
@@ -125,26 +130,13 @@
              _ASN1_TIME_print bioPtr time
                   >>= failIf_ (/= 1)
          timeStr <- bioRead bio
-         case parseTimeM True locale "%b %e %H:%M:%S %Y %Z" timeStr of
+#if MIN_VERSION_time(1,5,0)	       
+         case parseTimeM True defaultTimeLocale "%b %e %H:%M:%S %Y %Z" timeStr of
+#else
+         case parseTime defaultTimeLocale "%b %e %H:%M:%S %Y %Z" timeStr of
+#endif
            Just utc -> return utc
            Nothing  -> fail ("peekASN1Time: failed to parse time string: " ++ timeStr)
-    where
-      locale :: TimeLocale
-      locale = TimeLocale {
-                 wDays       = undefined
-               , months      = [ (undefined, x)
-                                     | x <- [ "Jan", "Feb", "Mar", "Apr", "May", "Jun"
-                                            , "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
-                                            ]
-                               ]
-               , amPm        = undefined
-               , dateTimeFmt = undefined
-               , dateFmt     = undefined
-               , timeFmt     = undefined
-               , time12Fmt   = undefined
-               , knownTimeZones = []
-               }
-
 
 allocaASN1Time :: (Ptr ASN1_TIME -> IO a) -> IO a
 allocaASN1Time
