TLS certificatesTLS証明書
By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a
reliable set of trust roots from Mozilla, and including them in uv improves portability and
performance (especially on macOS, where reading the system trust store incurs a significant delay).デフォルトでは、uvはバンドルされたwebpki-rootsクレートから証明書を読み込みます。webpki-rootsはMozillaからの信頼できるルートセットであり、これをuvに含めることでポータビリティとパフォーマンスが向上します(特にmacOSでは、システムの信頼ストアを読み込むのにかなりの遅延が発生します)。
System certificatesシステム証明書
In some cases, you may want to use the platform's native certificate store, especially if you're
relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's
certificate store. To instruct uv to use the system's trust store, run uv with the --native-tls
command-line flag, or set the UV_NATIVE_TLS environment variable to true.場合によっては、プラットフォームのネイティブ証明書ストアを使用したいことがあります。特に、システムの証明書ストアに含まれる企業の信頼ルート(例:必須プロキシ)に依存している場合です。uvにシステムの信頼ストアを使用するよう指示するには、--native-tlsコマンドラインフラグを使用してuvを実行するか、UV_NATIVE_TLS環境変数をtrueに設定します。
Custom certificatesカスタム証明書
If a direct path to the certificate is required (e.g., in CI), set the SSL_CERT_FILE environment
variable to the path of the certificate bundle, to instruct uv to use that file instead of the
system's trust store.証明書への直接パスが必要な場合(例:CIで)、SSL_CERT_FILE環境変数を証明書バンドルのパスに設定して、uvにシステムの信頼ストアの代わりにそのファイルを使用するよう指示します。
If client certificate authentication (mTLS) is desired, set the SSL_CLIENT_CERT environment
variable to the path of the PEM formatted file containing the certificate followed by the private
key.クライアント証明書認証(mTLS)が必要な場合は、SSL_CLIENT_CERT環境変数を証明書と秘密鍵を含むPEM形式のファイルのパスに設定します。
Insecure hosts安全でないホスト
If you're using a setup in which you want to trust a self-signed certificate or otherwise disable
certificate verification, you can instruct uv to allow insecure connections to dedicated hosts via
the allow-insecure-host configuration option. For example, adding the following to
pyproject.toml will allow insecure connections to example.com:自己署名証明書を信頼したり、証明書の検証を無効にしたりする設定を使用している場合、allow-insecure-host構成オプションを介してuvに特定のホストへの安全でない接続を許可するよう指示できます。たとえば、次の内容をpyproject.tomlに追加すると、example.comへの安全でない接続が許可されます:
allow-insecure-host expects to receive a hostname (e.g., localhost) or hostname-port pair (e.g.,
localhost:8080), and is only applicable to HTTPS connections, as HTTP connections are inherently
insecure.allow-insecure-hostはホスト名(例:localhost)またはホスト名-ポートペア(例:localhost:8080)を受け取ることを期待しており、HTTPS接続にのみ適用されます。HTTP接続は本質的に安全でないためです。
Use allow-insecure-host with caution and only in trusted environments, as it can expose you to
security risks due to the lack of certificate verification.allow-insecure-hostは注意して使用し、信頼できる環境でのみ使用してください。証明書の検証が行われないため、セキュリティリスクにさらされる可能性があります。