diff --git a/src/Test/Swagger/Gen.hs b/src/Test/Swagger/Gen.hs
--- a/src/Test/Swagger/Gen.hs
+++ b/src/Test/Swagger/Gen.hs
@@ -131,7 +131,7 @@
                  <>  [("Content-Type", fst <$> maybeMimeAndBody)]
 
     -- use scheme from operation, if defined, or from global
-    scheme <- elements $ fromMaybe [Https] (operation ^. schemes <|> s ^. schemes)
+    scheme <- elements $ fromMaybe [schemeForPort $ view port =<< mHost] (operation ^. schemes <|> s ^. schemes)
     pure ( operation
           , HttpRequest (buildHost scheme <$> mHost)
                         method
@@ -141,6 +141,10 @@
                         (snd <$> maybeMimeAndBody) )
 
  where
+  schemeForPort (Just 80) = Http
+  schemeForPort (Just 443) = Https
+  schemeForPort _ = Http
+
   buildHost :: Scheme -> Host -> String
   buildHost sc h = schemeToHttpPrefix sc <> (h ^. name) <> maybe "" ((':':) . show) (h ^. port)
 
diff --git a/swagger-test.cabal b/swagger-test.cabal
--- a/swagger-test.cabal
+++ b/swagger-test.cabal
@@ -1,5 +1,5 @@
 name:                swagger-test
-version:             0.2.1
+version:             0.2.2
 synopsis:            Testing of Swagger APIs
 description:         This package provides a library and executable tool
                      that supports testing APIs specified with Swagger. It
