• def post_xml(action, xml)
    apiclient_cert = cert_pem_to_x509(self.api_client_cert) apiclient_key = key_pem_to_rsa(self.api_client_key) conn = Faraday.new(ssl: {client_cert: apiclient_cert, client_key: apiclient_key}, headers: {'Content-Type' => 'application/xml'}) do |faraday| faraday.adapter Faraday.default_adapter end

    res = conn.post(pay_url(action), xml, {'Content-Type' => 'application/xml'})

    res end

    def cert_pem_to_x509(cert_pem) cert_x509 = OpenSSL::X509::Certificate.new cert_pem end

    def key_pem_to_rsa(key_pem) key_rsa = OpenSSL::PKey::RSA.new key_pem end

  • 牛!,不仅有很多 docker 的干货,而且还分享了 web terminal 的实现原理及方案

  • Rails 路由系统源码探索 at 2014年11月21日

    谢谢各位捧场,没想到处女贴,还能加精,有点小小的激动