Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Heroku上的OpenSSL-数据库连接丢失_Ruby On Rails_Heroku_Openssl - Fatal编程技术网

Ruby on rails Heroku上的OpenSSL-数据库连接丢失

Ruby on rails Heroku上的OpenSSL-数据库连接丢失,ruby-on-rails,heroku,openssl,Ruby On Rails,Heroku,Openssl,在Heroku Cedar上使用Postgres,当我尝试使用OpenSSL验证公钥时,与数据库的连接将丢失 # Recreate the error using a Base64 encoded key (BASE64_KEY below) you can go into the console and do the following: decoded_key = Base64.decode64(BASE64_KEY) public_key = OpenSSL::PKey::RSA.ne

在Heroku Cedar上使用Postgres,当我尝试使用OpenSSL验证公钥时,与数据库的连接将丢失

# Recreate the error using a Base64 encoded key (BASE64_KEY below) you can go into the console and do the following:

decoded_key = Base64.decode64(BASE64_KEY) 
public_key = OpenSSL::PKey::RSA.new(decoded_key) 
public_key.verify(OpenSSL::Digest::SHA1.new, "", "")

# Database connection is lost when this fails.
当验证通过时,一切都很好。我似乎无法在开发中复制这种行为


你知道为什么会这样吗?更好的是,有解决办法吗?

对于任何一个了解这一点的人,我最终完成了验证过程并读取了线程的结果。这样,主线程的数据库连接就不会丢失


虽然不太理想,但它确实有效

执行SSL代码后,使用以下命令重新连接Heroku数据库:

我们偶然发现了完全相同的问题,花了一周时间才意识到正是这一点导致了数据库连接的丢失。你有没有更深入地了解原因/解决方案,或者你只是把你的工作留在家里?最终还是把它留在了弗林利。与支持人士进行了广泛的讨论,最后他们的结论是“是的,OpenSSL是个婊子!”。说这句话的时候,我从来没有遇到过解决问题的麻烦。你需要注意内存泄漏,但这对我们来说从来都不是问题,我们以这种方式维护了几十万次身份验证。是的,我们也同样缺乏分辨率。不过我刚刚设法把它修好了!我们正在运行unicorn,并使用Heroku推荐的unicorn文件,该文件的底部有一些代码用于处理在线程服务器上重新连接数据库的问题。在SSL代码之后,我将这段代码复制到了我们的方法中,嘿,普雷斯托-它工作了!以下是文章: