Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Generate SSL For Cpanel

Discussion in 'cPanel Developers' started by krisrmgua, Mar 2, 2007.

  1. krisrmgua

    krisrmgua Registered PartnerNOC

    Mar 2, 2007
    Likes Received:
    Trophy Points:
    Im trying to write somecode to generate the KEY and CSR myself from a file on the site that needs the SSL. Yet when i generate the KEY with my code and copy it into cpanel for the key i get a message that Cpanel cant determin the host for the key. So i was wondering if anyone knows anything about the code on how to generate the key and csr? I am trying with php with this code

    $ssl_configargs = array(
    "digest_alg" => "sha1",
    "private_key_bits" => 1024,
    "private_key_type" => OPENSSL_KEYTYPE_RSA,
    "encrypt_key" => false
    $dn = array(
       "countryName" => "US",
       "stateOrProvinceName" => "CA",
       "localityName" => "domain",
       "organizationName" => "place",
       "organizationalUnitName" => "23",
       "commonName" => "",
       "emailAddress" => ""
    $numberofdays = "365";
    $pkey = openssl_pkey_new( $ssl_configargs );
    $csr = openssl_csr_new( $dn, $privkey, $ssl_configargs );
    $sscert = openssl_csr_sign( $csr, null, $privkey, $numberofdays );
    openssl_csr_export( $csr, $csrout );
    openssl_x509_export( $sscert, $certout );
    openssl_pkey_export( $privkey, $pkeyout);
    Anyone have any suggestions?

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice