fix: 添加SKIP_TLS_VERIFY选项用于跳过TLS证书校验 #2194
Open
+13
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题描述
我们可能会使用一些自己运行的模型,然后API使用了https协议,但是证书是自签名的,这种情况下one-api就代理不了这个模型,页面点击“测试”会报错:错误:do request failed: Post "https://1.1.1.1:4430/v1/chat/completions": tls: failed to verify certificate: x509: cannot validate certificate for 1.1.1.1 because it doesn't contain any IP SANs
解决办法
提供一个SKIP_TLS_VERIFY选项,可用于全局跳过TLS证书校验,默认不开启
自测截图