2020-12-21 11:45:07 +00:00
|
|
|
## Nim-BearSSL
|
2021-03-17 09:20:33 +00:00
|
|
|
## Copyright (c) 2018-2021 Status Research & Development GmbH
|
2020-12-21 11:45:07 +00:00
|
|
|
## Licensed under either of
|
|
|
|
## * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
|
|
|
## * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
|
|
|
## at your option.
|
|
|
|
## This file may not be copied, modified, or distributed except according to
|
|
|
|
## those terms.
|
|
|
|
|
|
|
|
## This module provides access to Mozilla's CA certificate store in PEM format.
|
|
|
|
## This certificate store was downloaded from
|
2021-03-17 09:20:33 +00:00
|
|
|
## https://curl.haxx.se/ca/cacert.pem
|
|
|
|
## And converted to C header using ``brssl ta cacert.pem > cacert.h``.
|
2020-12-21 11:45:07 +00:00
|
|
|
from decls import X509TrustAnchor
|
|
|
|
from strutils import rsplit
|
2021-03-17 09:20:33 +00:00
|
|
|
from os import DirSep, AltSep
|
2020-12-21 11:45:07 +00:00
|
|
|
|
2021-03-17 09:20:33 +00:00
|
|
|
const CurrentPath = currentSourcePath.rsplit({DirSep, AltSep}, 1)[0]
|
2020-12-21 11:45:07 +00:00
|
|
|
|
2021-03-17 09:20:33 +00:00
|
|
|
{.passC: "-I" & CurrentPath & "/certs".}
|
2020-12-21 11:45:07 +00:00
|
|
|
|
|
|
|
var MozillaTrustAnchors* {.
|
2021-03-17 09:20:33 +00:00
|
|
|
importc: "TAs", header: "cacert20210119.h".}: array[129, X509TrustAnchor]
|
2020-12-21 11:45:07 +00:00
|
|
|
var MozillaTrustAnchorsCount* {.
|
2021-03-17 09:20:33 +00:00
|
|
|
importc: "TAs_NUM", header: "cacert20210119.h".}: cint
|