diff options
author | Cédric Couralet <cedric.couralet@gmail.com> | 2020-04-13 23:58:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-13 14:58:42 -0700 |
commit | 34775b4128de2801e4d127064f012501ca18d208 (patch) | |
tree | 7e88716b3404b5d91839979fe8d882b1dbed7ca5 /src/Text/Pandoc/Class/PandocMonad.hs | |
parent | 21b1358a52d2825dbfa825ae06e7b15d022cc12c (diff) | |
download | pandoc-34775b4128de2801e4d127064f012501ca18d208.tar.gz |
Add an option to disable certificate validation (#6156)
This commit adds the option `--no-check-certificate`, which disables certificate
checking when resources are fetched by HTTP.
Co-authored-by: Cécile Chemin <cecile.chemin@insee.fr>
Co-authored-by: Juliette Fourcot <juliette.fourcot@insee.fr>
Diffstat (limited to 'src/Text/Pandoc/Class/PandocMonad.hs')
-rw-r--r-- | src/Text/Pandoc/Class/PandocMonad.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Class/PandocMonad.hs b/src/Text/Pandoc/Class/PandocMonad.hs index 8229668e7..991aeed41 100644 --- a/src/Text/Pandoc/Class/PandocMonad.hs +++ b/src/Text/Pandoc/Class/PandocMonad.hs @@ -27,6 +27,7 @@ module Text.Pandoc.Class.PandocMonad , report , setTrace , setRequestHeader + , setNoCheckCertificate , getLog , setVerbosity , getVerbosity @@ -189,6 +190,10 @@ setRequestHeader name val = modifyCommonState $ \st -> st{ stRequestHeaders = (name, val) : filter (\(n,_) -> n /= name) (stRequestHeaders st) } +-- | Determine whether certificate validation is disabled +setNoCheckCertificate :: PandocMonad m => Bool -> m () +setNoCheckCertificate noCheckCertificate = modifyCommonState $ \st -> st{stNoCheckCertificate = noCheckCertificate} + -- | Initialize the media bag. setMediaBag :: PandocMonad m => MediaBag -> m () setMediaBag mb = modifyCommonState $ \st -> st{stMediaBag = mb} |