For Gauche 0.9.9

Next: , Previous: , Up: ライブラリモジュール - ユーティリティ   [Contents][Index]

12.42 rfc.tls - トランスポート・レイヤ・セキュリティ

Module: rfc.tls

This module handles secure connection over TCP socket. This module is used by rfc.http (see HTTP).

We haven’t yet got other use cases than https connections, so we’re not sure how API of this layer should look like. At this moment, we document the minimal features you need to know to use the TLS layer with rfc.http.

Gauche supports two TLS subsystems - one based on axTLS (, and the other based on mbedTLS ( Whether they’re included depends on the configuration options. By default, axTLS support is compiled in, and mbedTLS support is only included if the build platform has mbedTLS library installed. And axTLS is set to be used by default.

Whether the running Gauche has any of TLS support can be checked with a feature identifier Availability of each individual subsystems can be checked with feature identifiers and, respectively. See 機能条件式, for more about feature identifiers.

In the current version, we verify certificates by default. You need to specify the location of CA certificates explicitly when you want to verify, unless the CA certificate location is specified at the configuration time. In future, we might set the default CA certificate file automatically so that users don’t need to bother by default, but not now.

Class: <ax-tls>

{rfc.tls} A class that implements axTLS subsystem interface.

Class: <mbed-tls>

{rfc.tls} A class that implements mbedTLS subsystem interface.

Parameter: default-tls-class :optional class

{rfc.tls} Set/get the default TLS subsystem to be used. Without arguments, it return a class (either <ax-tls> or <mbed-tls> to be used. With one argument, which must be either <ax-tls> or <mbed-tls>, changes the default and returns the previous value.

Parameter: tls-ca-bundle-path :optional path

{rfc.tls} Set/get the CA certificate bundle path to be used. Without arguments, it returns the current path. With one argument, a pathname to the CA bundle file, updates the parameter to the new value and returns the previous value.

Some platform can load CA bundle from system certificate store. If you sets path to symbol system on such platform, use system certificate store as CA certificate bundle.

If you use mbedTLS with CA bundle file, you need to set this value to the valid CA bundle file path. Unfortunately there’s no globally agreed location for such file. If you need one, one choice is to fetch it from, store it locally and set its path to tls-ca-bundle-path. (We can’t automatically do that, since we can’t securely fetch the file before we get valid CA certs!)

Next: , Previous: , Up: ライブラリモジュール - ユーティリティ   [Contents][Index]