[Bps-public-commit] rt-extension-assets-applegsx branch, master, updated. 1.0-10-g02caa20

Jim Brandt jbrandt at bestpractical.com
Fri Sep 30 15:33:44 EDT 2016


The branch, master has been updated
       via  02caa20a9c4010a5e3289618b22803ad56abfdaa (commit)
       via  5595f554ca3b4e7ed4d84fa5f2489ecb9f35835e (commit)
       via  94aba7305c47ddc014a1e40abc356df8e199ec3c (commit)
       via  14c4e450f5f25b32db0c2f655900103aa156f798 (commit)
       via  71119fc6a7c2f7482201dda58434308e8cc0f44c (commit)
      from  f5a26b3488939666a42d8251ac16f5edda203d96 (commit)

Summary of changes:
 MANIFEST                                   |  4 +++-
 META.yml                                   |  2 +-
 lib/RT/Extension/Assets/AppleGSX.pm        |  2 +-
 lib/RT/Extension/Assets/AppleGSX/Client.pm | 18 ++++++++++++++----
 4 files changed, 19 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit 71119fc6a7c2f7482201dda58434308e8cc0f44c
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Sep 9 09:53:59 2016 -0400

    Update MANIFEST

diff --git a/MANIFEST b/MANIFEST
index 4f6178e..39af8ce 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -8,14 +8,16 @@ inc/Module/Install.pm
 inc/Module/Install/Base.pm
 inc/Module/Install/Can.pm
 inc/Module/Install/Fetch.pm
+inc/Module/Install/Include.pm
 inc/Module/Install/Makefile.pm
 inc/Module/Install/Metadata.pm
 inc/Module/Install/ReadmeFromPod.pm
 inc/Module/Install/RTx.pm
-inc/Module/Install/RTx/Factory.pm
+inc/Module/Install/RTx/Runtime.pm
 inc/Module/Install/Substitute.pm
 inc/Module/Install/Win32.pm
 inc/Module/Install/WriteAll.pm
+inc/YAML/Tiny.pm
 lib/RT/Extension/Assets/AppleGSX.pm
 lib/RT/Extension/Assets/AppleGSX/Client.pm
 Makefile.PL

commit 14c4e450f5f25b32db0c2f655900103aa156f798
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Sep 9 14:27:12 2016 -0400

    Update to pass cert via environment variables

diff --git a/lib/RT/Extension/Assets/AppleGSX.pm b/lib/RT/Extension/Assets/AppleGSX.pm
index a8d9202..4007c04 100644
--- a/lib/RT/Extension/Assets/AppleGSX.pm
+++ b/lib/RT/Extension/Assets/AppleGSX.pm
@@ -3,7 +3,7 @@ use warnings;
 package RT::Extension::Assets::AppleGSX;
 use RT::Extension::Assets::AppleGSX::Client;
 
-our $VERSION = '1.1';
+our $VERSION = '1.2';
 
 my $CLIENT;
 my $CLIENT_CACHE;
diff --git a/lib/RT/Extension/Assets/AppleGSX/Client.pm b/lib/RT/Extension/Assets/AppleGSX/Client.pm
index 268ffba..ed7fdc8 100644
--- a/lib/RT/Extension/Assets/AppleGSX/Client.pm
+++ b/lib/RT/Extension/Assets/AppleGSX/Client.pm
@@ -18,9 +18,9 @@ sub new {
     my $class = shift;
     my $args  = ref $_[0] eq 'HASH' ? shift @_ : {@_};
     my $self  = $class->SUPER::new($args);
+    $ENV{HTTPS_CERT_FILE} = $self->CertFilePath;
+    $ENV{HTTPS_KEY_FILE} = $self->KeyFilePath;
     $self->UserAgent( LWP::UserAgent->new() ) unless $self->UserAgent;
-    $self->UserAgent->ssl_opts( SSL_cert_file => $self->CertFilePath,
-                                SSL_key_file => $self->KeyFilePath );
     return $self;
 }
 
@@ -50,6 +50,7 @@ sub Authenticate {
     }
     else {
         warn "Failed to authenticate to Apple GSX: " . $res->status_line;
+        warn "Full response: " . $res->content;
         return;
     }
 }
@@ -110,6 +111,7 @@ sub PrepareXML {
 <?xml version="1.0" encoding="UTF-8"?>
 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:glob="http://gsxws.apple.com/elements/global">
+<soapenv:Header/>
 $xml
 </soapenv:Envelope>
 EOF

commit 94aba7305c47ddc014a1e40abc356df8e199ec3c
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Sep 9 14:27:47 2016 -0400

    Update for version 1.2

diff --git a/META.yml b/META.yml
index a8d3d66..40ca279 100644
--- a/META.yml
+++ b/META.yml
@@ -30,6 +30,6 @@ requires:
   perl: 5.8.3
 resources:
   license: http://opensource.org/licenses/gpl-license.php
-version: '1.1'
+version: '1.2'
 x_module_install_rtx_version: '0.37'
 x_requires_rt: 4.0.0

commit 5595f554ca3b4e7ed4d84fa5f2489ecb9f35835e
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Sep 9 14:37:59 2016 -0400

    Point to testing domain for Test certs

diff --git a/lib/RT/Extension/Assets/AppleGSX/Client.pm b/lib/RT/Extension/Assets/AppleGSX/Client.pm
index ed7fdc8..1d65585 100644
--- a/lib/RT/Extension/Assets/AppleGSX/Client.pm
+++ b/lib/RT/Extension/Assets/AppleGSX/Client.pm
@@ -131,8 +131,15 @@ sub ParseResponseXML {
 sub SendRequest {
     my $self = shift;
     my $xml  = shift;
+
+    my $domain = 'https://gsxapi.apple.com';
+
+    # Apple standard appears to be to use 'Test' for testing environment
+    # certs.
+    $domain = 'https://gsxapiut.apple.com' if $self->CertFilePath =~ /Test/;
+
     my $res  = $self->UserAgent->post(
-        'https://gsxapi.apple.com/gsx-ws/services/am/asp',
+        "$domain/gsx-ws/services/am/asp",
         'Content-Type' => 'text/xml; charset=utf-8',
         Content        => $xml,
     );

commit 02caa20a9c4010a5e3289618b22803ad56abfdaa
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Sep 30 15:33:35 2016 -0400

    Update SSL config to connect to Apple servers

diff --git a/lib/RT/Extension/Assets/AppleGSX/Client.pm b/lib/RT/Extension/Assets/AppleGSX/Client.pm
index 1d65585..c0e536a 100644
--- a/lib/RT/Extension/Assets/AppleGSX/Client.pm
+++ b/lib/RT/Extension/Assets/AppleGSX/Client.pm
@@ -3,6 +3,7 @@ use warnings;
 
 package RT::Extension::Assets::AppleGSX::Client;
 
+use Net::SSL;
 use LWP::UserAgent;
 
 use XML::Simple;
@@ -20,7 +21,7 @@ sub new {
     my $self  = $class->SUPER::new($args);
     $ENV{HTTPS_CERT_FILE} = $self->CertFilePath;
     $ENV{HTTPS_KEY_FILE} = $self->KeyFilePath;
-    $self->UserAgent( LWP::UserAgent->new() ) unless $self->UserAgent;
+    $self->UserAgent( LWP::UserAgent->new(ssl_opts => { verify_hostname => 0 }) ) unless $self->UserAgent;
     return $self;
 }
 

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list