scotty-tls: TLS for Scotty

[ bsd3, library, web ] [ Propose Tags ] [ Report a vulnerability ]

Run your Scotty apps over TLS


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.3.0.0, 0.4.0, 0.4.1, 0.5.0, 0.6.0
Change log CHANGELOG.md
Dependencies base (<5), scotty (>=0.21.0 && <0.23), transformers (>=0.3.0.0 && <0.7), wai (>=3.2 && <3.3), warp (>=3.3 && <3.5), warp-tls (>=3.4 && <3.5) [details]
License BSD-3-Clause
Author David Johnson
Maintainer code@dmj.io
Category Web
Home page https://github.com/dmjio/scotty-tls.git
Source repo head: git clone git://github.com/scotty-web/scotty-tls.git
Uploaded by DavidJohnson at 2025-04-28T16:48:48Z
Distributions
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 3883 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2025-04-30 [all 3 reports]

Readme for scotty-tls-0.6.0

[back to package description]

Scotty-TLS

You can test by generating a self-signed certificate like this:

openssl req -nodes -newkey rsa:2048 -keyout example.key -out example.csr \
    -subj "/C=GB/ST=London/L=London/O=Acme Widgets/OU=IT Department/CN=example.com"
openssl x509 -req -days 365 -in example.csr -signkey example.key -out example.crt

For more details on making certificates, see this guide.

Install and run with:

cabal update && cabal install scotty-tls
{-# LANGUAGE OverloadedStrings #-}

import           Data.Monoid    (mconcat)
import           Web.Scotty
import           Web.Scotty.TLS

main :: IO ()
main = scottyTLS 3000 "server.key" "server.crt" $ do
         get "/:word" $ do
             beam <- param "word"
             html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"]