The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

bug in new ssl system / api call

Discussion in 'cPanel Developers' started by deepunix, Jul 5, 2013.

  1. deepunix

    deepunix Registered

    Joined:
    Sep 20, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Assuming you've got the following cert:

    -----BEGIN CERTIFICATE-----
    MIIEWjCCAkKgAwIBAgIDBN8OMA0GCSqGSIb3DQEBBQUAMHkxEDAOBgNVBAoTB1Jv
    b3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEiMCAGA1UEAxMZ
    Q0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYSc3VwcG9y
    dEBjYWNlcnQub3JnMB4XDTA4MDMyNTAwMjgzMFoXDTA4MDkyMTAwMjgzMFowHTEb
    MBkGA1UEAxMSc3VnYXIuc3RpbXVsYW50LmlvMIGfMA0GCSqGSIb3DQEBAQUAA4GN
    ADCBiQKBgQDR6Kw5RYfUhLQ1cfmPCWj7ayXQspoIS6wKZ3arlL3oLCPtqptM3VAk
    yRdmmXL+/SEekV7j4euVxI2rkjn4OL4/YKQBI9eKtqgu0bt+VX5OIcgQ/mVilVTa
    /Py/Gxl2EK08c4oYAIlfDdZzCMrOzo134h833dLiCdtO+IJNn2ljuQIDAQABo4HK
    MIHHMAwGA1UdEwEB/wQCMAAwNAYDVR0lBC0wKwYIKwYBBQUHAwIGCCsGAQUFBwMB
    BglghkgBhvhCBAEGCisGAQQBgjcKAwMwCwYDVR0PBAQDAgWgMDMGCCsGAQUFBwEB
    BCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuY2FjZXJ0Lm9yZy8wPwYDVR0R
    BDgwNoISc3VnYXIuc3RpbXVsYW50LmlvoCAGCCsGAQUFBwgFoBQMEnN1Z2FyLnN0
    aW11bGFudC5pbzANBgkqhkiG9w0BAQUFAAOCAgEAhLKsjrJjuV//zO7BpEhzqnFr
    fzJxLMBYuufY6FhCZwkp6dWPkOdFsHCXF5kG4v+dnzFUBmImGezGRyszSxshM/AZ
    4tcRXUYNKfenpHahFvxf9JhB5fw46895cjbH8YX6AJsicZkvCsFYObHxKI7T2mf8
    qsM49298glf/0pnkyy/78sjFueUJQtePCb3LlV9qTqIyrGxhxGgF6/Gc1njO9CU4
    67xJQvZMcZMldTj6Z7/ytHfXg2KJ1ijrrwVliitHpv51FFIltkDAwREtFOmpWUbZ
    jwOaZPvRGiL9OokCsg+xehppfbkhnHnuiTELuXMZpt1fcWFKkH2C6xHFjbzx1KWX
    pzOJHE1mIRZUCugKrCFFk8YxfbkD95zAJEblJL/GS2N5LJLr4vTgkIkxH0ulml4q
    K7r68lPWy3zaYvHBrwuETLbyl8XzuXgq0NwIS943inHtQEZsTc/koWkdDnWFnutx
    Ih+RQGjOO1BxdRyQTy3vEPusfsoV9oCG3kdV0Zu7mkla0gU2rf6dkrvJIwZpSOOv
    4CdrhAAE/6YuX34cli9E3ORk5kp80M2psXnzgoGdBgewS9l3JIFRCb0RLqd2WBSl
    8nRfiPdbCwv2DabNk8JKCSD0KQoiba8gbFKvjlM84UjOYSdQiHjXrfFpPfWG0Gxb
    81ohNniQbDEAqMwKY2A=
    -----END CERTIFICATE-----


    you get the following in /var/cpanel/ssl/system/ssl.db :
    Code:
        sugar_stimulant_io_d1e8a_963b9_1221956910_2292d9416ddcb285b5354bbbe6fa3b9f:
          created: '1371200220'
          domains:
            - sugar.stimulant.io
            -
              -
                binary: !!perl/ref
                  =: "+\x06\x01\x05\x05\a\b\x05"
                identval: 6
                tagnum: 6
                type:
                  - universal
                  - primitive
                  - oid
                value: 1.3.6.1.5.5.7.8.5
              -
                identval: 160
                tagnum: 0
                type:
                  - context
                  - constructed
                  - 0
                value:
                  -
                    binary: !!perl/ref
                      =: sugar.stimulant.io
                    identval: 12
                    tagnum: 12
                    type:
                      - universal
                      - primitive
                      - utf8_string
                    value: sugar.stimulant.io
          friendly_name: sugar.stimulant.io.crt
          id: sugar_stimulant_io_d1e8a_963b9_1221956910_2292d9416ddcb285b5354bbbe6fa3b9f
          is_self_signed: 0
          issuer.commonName: CA Cert Signing Authority
          issuer.organizationName: Root CA
          modulus: d1e8ac394587d484b43571f98f0968fb6b25d0b29a084bac0a6776ab94bde82c23edaa9b4cdd5024c917669972fefd211e915ee3e1eb95c48dab9239f838be3f60a40123d78ab6a82ed1bb7e557e4e21c810fe65629554dafcfcbf1b197610ad3c738a1800895f0dd67308cacece8d77e21f37ddd2e209db4ef8824d9f6963b9
          modulus_length: 1024
          not_after: '1221956910'
          not_before: '1206404910'
          subject.commonName: sugar.stimulant.io
    
    you get consistent errors in listcrts function:

    Code:
    # /usr/local/cpanel/whostmgr/bin/xml-api -json ./listcrts
    HTTP/1.0 200 OK
    Content-type: text/plain; charset="utf-8"
    
    [2013-07-05 05:50:17 -0400] die [Internal Death while parsing [stdin] 27698] cannot encode reference to scalar 'SCALAR(0x2afe43eebef0)' unless the scalar is 0 or 1 at /usr/local/cpanel/Cpanel/JSON.pm line 43.
            Cpanel::JSON::Dump('HASH(0x2afe43edf9d0)') called at /usr/local/cpanel/Whostmgr/ApiHandler.pm line 19
            Whostmgr::ApiHandler::out('HASH(0x2afe43edf9d0)', 'RootName', 'listcrts', 'NoAttr', 1) called at /usr/local/cpanel/Whostmgr/XMLUI/SSL.pm line 113
            Whostmgr::XMLUI::SSL::listcrts() called at whostmgr/bin/xml-api line 1824
            main::__ANON__('HASH(0x27a76f0)') called at whostmgr/bin/xml-api line 3286
            main::runapp_v0('HASH(0x27a76f0)') called at whostmgr/bin/xml-api line 3336
            main::runapp('listcrts', 'HASH(0x560ea40)', 'HASH(0x27a76f0)') called at whostmgr/bin/xml-api line 3210
    
    Didn't check other functions. Appears as clear bug to me. Thanks.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
Loading...

Share This Page