Gem 为什么有些 Gem 要自己包凭证在里面呢?

artone · August 04, 2020 · Last by kai209209 replied at August 04, 2020 · 1480 hits

我在研究这个 PayPal-Rub-SDK 这个 gem:

https://github.com/paypal/PayPal-Ruby-SDK

他在发送 request 给 API 前指定了目录下包好的一个 .crt 档案:

来源(GitHub)

想请问:

  • 为什么这么做呢?
  • 这样有什么好处呢?

因为现在这个 gem 的 SSL 凭证其实已经过期了,所以程式其实是坏的,我把这一行移除掉:

https.ca_file = default_ca_file

程式就好了,测试就过了!但是这样移除会有什么问题吗?

事实上,这里有一个 ssl option 可配置

https://www.paypal.com/us/smarthelp/article/ts2240 把 paypal 给的最新的 certificates: DigiCert High Assurance EV Root CA 或者 DigiCert Global Root G2 放进去

artone closed this topic. 05 Aug 01:06
You need to Sign in before reply, if you don't have an account, please Sign up first.