SSL problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fader_Berg
    Junior Member
    • Aug 2015
    • 2

    #1

    SSL problem

    Hi...

    I've been struggling with a SSL problem which I can't solve by my self.

    I've generated the certificate and private key files by the instructions at API-NG | Non-Interactive (bot) login.
    I've also uploaded the .crt file to betfair, to link it to my account.

    When testing everything with the curl example, I get a SSL error.
    Code:
    curl -q -k --cert ./client-2048.crt --key ./client-2048.key https://identitysso.betfair.com/api/certlogin -d "username=xxx&password=xxx" -H "X-Application: xxx"
    
    curl: (56) SSL peer was unable to negotiate an acceptable set of security parameters.
    I'm running Fedora22 and used the openssl tools that comes with it.

    Thanks for your help...
  • merecat_
    Junior Member
    • May 2009
    • 35

    #2
    Hi, never tried the curl command before but I just tried yours on my system (xubuntu) and it works fine (if that helps).

    To set my system up I followed the 'non-interactive (bot) login' procedure here:
    https://api.developer.betfair.com/se...28bot%29+login

    I guess you have all the certificate files in the same directory from which you run curl right?

    After I went through the process it created all these...

    Jul 12 2014 client-2048.crt
    Jul 12 2014 client-2048.csr
    Jul 12 2014 client-2048.key
    Jul 12 2014 client-2048.p12
    Jul 12 2014 client-2048.pem

    Can't offer any more help sorry, I'm rather clueless with SSL and personally find the whole thing logically 'easy' to understand but have little idea about all the physical implementation - I just followed Betfair's procedure and it worked.

    I notice there's a --verbose switch on the curl command, might want to try that, in case it provides any more clues as to why it's failing.

    Good luck.

    Comment

    • merecat_
      Junior Member
      • May 2009
      • 35

      #3
      BTW the response I get with --verbose is...

      * Hostname was NOT found in DNS cache
      * Trying 84.20.200.150...
      * Connected to identitysso.betfair.com (84.20.200.150) port 443 (#0)
      * successfully set certificate verify locations:
      * CAfile: none
      CApath: /etc/ssl/certs
      * SSLv3, TLS handshake, Client hello (1):
      * SSLv3, TLS handshake, Server hello (2):
      * SSLv3, TLS handshake, CERT (11):
      * SSLv3, TLS handshake, Server finished (14):
      * SSLv3, TLS handshake, Client key exchange (16):
      * SSLv3, TLS change cipher, Client hello (1):
      * SSLv3, TLS handshake, Finished (20):
      * SSLv3, TLS change cipher, Client hello (1):
      * SSLv3, TLS handshake, Finished (20):
      * SSL connection using AES128-SHA
      * Server certificate:
      * subject: C=GB; ST=London; L=London; O=The Sporting Exchange Limited; OU=IT Networks; CN=betfair.com
      * start date: 2015-05-27 15:24:16 GMT
      * expire date: 2017-05-27 15:24:15 GMT
      * issuer: C=US; O=HydrantID (Avalanche Cloud Corporation); CN=HydrantID SSL ICA G2
      * SSL certificate verify ok.
      > POST /api/certlogin HTTP/1.1
      > User-Agent: curl/7.35.0
      > Host: identitysso.betfair.com
      > Accept: */*
      > X-Application: THIS_IS_PRIVATE
      > Content-Length: 34
      > Content-Type: application/x-www-form-urlencoded
      >
      * upload completely sent off: 34 out of 34 bytes
      * SSLv3, TLS handshake, Hello request (0):
      * SSLv3, TLS handshake, Client hello (1):
      * SSLv3, TLS handshake, Server hello (2):
      * SSLv3, TLS handshake, CERT (11):
      * SSLv3, TLS handshake, Request CERT (13):
      * SSLv3, TLS handshake, Server finished (14):
      * SSLv3, TLS handshake, CERT (11):
      * SSLv3, TLS handshake, Client key exchange (16):
      * SSLv3, TLS handshake, CERT verify (15):
      * SSLv3, TLS change cipher, Client hello (1):
      * SSLv3, TLS handshake, Finished (20):
      * SSLv3, TLS change cipher, Client hello (1):
      * SSLv3, TLS handshake, Finished (20):
      < HTTP/1.1 200 OK
      < Content-Type: text/plain;charset=ISO-8859-1
      < Content-Length: 87
      < Date: Sun, 09 Aug 2015 10:18:41 GMT
      < Vary: Accept-Encoding
      <
      * Connection #0 to host identitysso.betfair.com left intact
      {"sessionToken":"THIS_IS_PRIVATE_TOO","loginStatus ":"SUCCESS"}

      Comment

      • Fader_Berg
        Junior Member
        • Aug 2015
        • 2

        #4
        Thanks for help. I should have known about the
        Code:
        --verbose
        . It made the difference. Thanks again.

        For the record...

        It seems that Fedora uses TLSv1.2 for SSL connection per default and Betfair uses 1.1. That's why it doesn't work. Adding the
        Code:
        --tlsv1.1
        to the curl command line (and probably CURLOPT in libcurl) solves the problem.

        Comment

        Working...
        X