簡體   English   中英

ssl 在 rails 6 中使用 devise 發送郵件時出錯

[英]ssl erros sending mail using devise in rails 6

我正在生產中部署 Rails 6。 我正在測試 devise 的郵件 function 並且收到此錯誤

OpenSSL::SSL::SSLError (hostname "localhost" does not match the server certificate):

我怎樣才能解決這個問題?

謝謝

問題

如果在 Rails 上運行 Ruby 時遇到這個問題:

OpenSSL::SSL::SSLError (hostname "localhost" doesn't match the server certificate) 這可能是由於 ActionMailer 使用 smtp 作為投遞證書,但沒有正確的本地郵件/驗證證書。

解決方案

您可以添加有效證書,但如果服務器僅用於發送郵件,則可能不適合。 在這種情況下,您可以將 delivery_method 更改為 sendmail,這使得 ActionMailer 直接使用 sendmail 二進制文件。

資源

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM