# SSL\_connect 返回=1 errno=0 peeraddr=162.243.189.2:443 状态=错误：证书验证失败 (主机名不匹配)

**URL:** <https://meta.discourse.org/t/ssl-connect-returned-1-errno-0-peeraddr-162-243-189-2-443-state-error-certificate-verify-failed-hostname-mismatch/269824>\
**Category:** Self-hosting\
**Tags:** s3\
**Created:** [2023年六月27日 21:30 UTC](https://meta.discourse.org/t/ssl-connect-returned-1-errno-0-peeraddr-162-243-189-2-443-state-error-certificate-verify-failed-hostname-mismatch/269824 "2023-06-27T21:30:25Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![the220hq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/the220hq/32/332255_2.png) [@the220hq](https://meta.discourse.org/u/the220hq)\
**Post date:** [2023年十一月9日 02:55 UTC](https://meta.discourse.org/t/ssl-connect-returned-1-errno-0-peeraddr-162-243-189-2-443-state-error-certificate-verify-failed-hostname-mismatch/269824/16 "2023-11-09T02:55:22Z")

</div>

是的，您在关闭它时是对的。我想找到原因，以便在 ruby 库出错时提交一个 PR。

我的设置非常简单，只是尝试将图像上传到 S3 兼容存储。

```plaintext
  DISCOURSE_USE_S3: true
  DISCOURSE_S3_REGION: <region>
  DISCOURSE_S3_ENDPOINT: https://<namespace>.compat.objectstorage.<region>.oraclecloud.com
  DISCOURSE_S3_ACCESS_KEY_ID: <access_key_id>
  DISCOURSE_S3_SECRET_ACCESS_KEY: <access_key>
  DISCOURSE_S3_BUCKET: <bucket_name>

```

Oracle Cloud Storage 对端点地址有一些格式要求。但无论我尝试哪种格式，都会出现我上面显示的相同错误消息。

```plaintext
SSL_connect returned=1 errno=0 peeraddr=134.70.128.1:443 state=error: certificate verify failed (Hostname mismatch)

```

我上面使用的格式，我已经检查了证书，在我看来是正确的：

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/3/0/8304c0e5477b9409bc3b0087f6959fd16af02782.png)

正如我之前所说，我使用此设置通过 s3cmd 工具正常连接。非常感谢！

---

_[View the full topic](https://meta.discourse.org/t/ssl-connect-returned-1-errno-0-peeraddr-162-243-189-2-443-state-error-certificate-verify-failed-hostname-mismatch/269824)._
