Gauche:mbedtlsをインストール
mbed TLS Source Code: Fully open-source
インストール
$HOME/localに入れた。
$ wget https://tls.mbed.org/download/mbedtls-2.16.6-apache.tgz
$ tar -zxf mbedtls-2.16.6-apache.tgz
$ cd mbedtls-2.16.6
$ make #FreeBSDの場合は、gmake
$ make install DESTDIR=$HOME/local #FreeBSDの場合は、gmake
configureはいらない。
Mbed TLS should build out of the box on most systems. Some platform specific options are available in the fully documented configuration file `include/mbedtls/config.h`, which is also the place where features can be selected. This file can be edited manually, or in a more programmatic way using the Perl script `scripts/config.pl` (use `--help` for usage instructions).
READMEより
確認
$ ls $HOME/local/lib | grep mbed
libmbedcrypto.a
libmbedtls.a
libmbedx509.a
Gaucheを再コンパイル
configure に --with-local=$HOME/local オプションをつける
サイト証明書
curl - Extract CA Certs from Mozilla から cacert.pem をダウンロードして使う。
ただし、サイト証明書は年に数回変更されているので、都度更新の必要あり。
使い方
(use rfc.tls)
(default-tls-class <mbed-tls>)
(tls-ca-bundle-path (sys-normalize-pathname "~/ca/cacert.pem" :expand #t))
(use rfc.http)
(receive (status header-list body)
(http-get "syosetu.org" "/" :secure #t)
(print status))