Permalink
Browse files

Merge pull request #3 from phusion/master

Verify all FastSpring connections using the FastSpring certificate
  • Loading branch information...
2 parents f67fa95 + 97f07fb commit 2909a18ce2426ff8f9d2b33017c0b959cdceaa16 @patchfx committed May 24, 2012
@@ -1,8 +1,14 @@
module FastSpring
- module Account
+ DEFAULT_SSL_CA_FILE = File.expand_path(File.dirname(__FILE__) + "/fastspring.crt")
+ module Account
def self.config
- @config ||= {:username => 'user', :password => 'pass', :company => 'your-company'}
+ @config ||= {
+ :username => 'user',
+ :password => 'pass',
+ :company => 'your-company',
+ :ssl_ca_file => DEFAULT_SSL_CA_FILE
+ }
end
def self.[]=(key, val)
@@ -0,0 +1,93 @@
+-----BEGIN CERTIFICATE-----
+MIIFSTCCBDGgAwIBAgIQHcefyOMYtLlA+u2r7DMhqjANBgkqhkiG9w0BAQUFADCB
+tTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL
+ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTswOQYDVQQLEzJUZXJtcyBvZiB1c2Ug
+YXQgaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JwYSAoYykxMDEvMC0GA1UEAxMm
+VmVyaVNpZ24gQ2xhc3MgMyBTZWN1cmUgU2VydmVyIENBIC0gRzMwHhcNMTIwNTEx
+MDAwMDAwWhcNMTMwNTEyMjM1OTU5WjCBhTELMAkGA1UEBhMCVVMxEzARBgNVBAgT
+CkNhbGlmb3JuaWExFjAUBgNVBAcUDVNhbnRhIEJhcmJhcmExGTAXBgNVBAoUEEJy
+aWdodE1hcmtldCBMTEMxEzARBgNVBAsUCkZhc3RTcHJpbmcxGTAXBgNVBAMUECou
+ZmFzdHNwcmluZy5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9
+aTmLBj/CmTeCsGzeDaobgBg5PCOL5Idj4djCNmYNcck/jMTbdfbCrRrWk+lw7fky
+hb1rT+HDhy9nUKfgspG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r8Vd6Gw9KIl8q8ckmcY5fQG
+BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+
+rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/
+NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E
+BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH
+BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy
+aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv
+MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE
+p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y
+5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK
+WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ
+4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N
+hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq
+-----END CERTIFICATE-----
@@ -3,7 +3,7 @@ class Order < PrivateApiBase
attr_reader :purchaser, :items
# Get the order from Saasy
def find
- @response = self.class.get(base_order_path, :basic_auth => @auth)
+ @response = self.class.get(base_order_path, :basic_auth => @auth, :ssl_ca_file => @ssl_ca_file)
self
end
@@ -12,6 +12,7 @@ def initialize(reference)
:password => FastSpring::Account.fetch(:password)}
@company = FastSpring::Account.fetch(:company)
@reference = reference
+ @ssl_ca_file = FastSpring::Account.fetch(:ssl_ca_file)
end
def self.find(reference)
@@ -5,7 +5,7 @@ class Subscription < PrivateApiBase
# Get the subscription from Saasy
def find
- @response = self.class.get(base_subscription_path, :basic_auth => @auth)
+ @response = self.class.get(base_subscription_path, :basic_auth => @auth, :ssl_ca_file => @ssl_ca_file)
self
end

0 comments on commit 2909a18

Please sign in to comment.