{"id":49697,"date":"2018-06-21T13:00:00","date_gmt":"2018-06-21T18:00:00","guid":{"rendered":"https:\/\/blog.cpanel.com\/?p=49697"},"modified":"2018-06-21T13:00:00","modified_gmt":"2018-06-21T18:00:00","slug":"new-ssl-standard-hooks-for-cpanel-whm-integrators","status":"publish","type":"post","link":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/","title":{"rendered":"New SSL Standard Hooks for cPanel & WHM Integrators!"},"content":{"rendered":"

Hello, all you lovely people out in third-party developerland!<\/p>\n

Don’t you hate it when you’re installing an SSL certificate through a script or API calls, but there’s some action that you want to take before or after the installation? Well, thanks to the hardworking folks on the Development Team,\u00a0cPanel & WHM Version<\/a>\u00a0now includes a Standardized Hook for the SSL Installation event.<\/p>\n

What is a Standard Hook?<\/h2>\n

Standardized Hooks<\/a>\u00a0are our way to help developers trigger events when cPanel & WHM performs a specific action. Developers use the Standard Hooks system to execute custom code (hook action code) to customize how cPanel & WHM reacts in specific scenarios (hookable events<\/a>). For example, you could use this system to make certain that a script runs each time a cPanel account is created or terminated.<\/p>\n

Take advantage of the new SSL Hooks<\/h2>\n

With the new hooks, you can automatically run code before and after the installation process. For example, if you want to touch a file\u00a0\u00a0\/var\/cpanel\/hooks_test_log_post<\/code>\u00a0whenever an SSL is installed you would create the\u00a0\/usr\/local\/cpanel\/3rdparty\/bin\/t<\/a>echhookpost.pm<\/code>\u00a0script hook with\u00a0the following code\u00a0\u00a0(provided in\u00a0Perl<\/a>):<\/p>\n\n\n\n
\n
package Testhookpost;\n   \nuse strict;\nuse warnings;\n     \nuse JSON;\n   \n# Embed hook attributes alongside the action code.\nsub describe {\n    my $my_add = {\n        'category' => 'Whostmgr',\n        'event'    => 'SSL::installssl',\n        'stage'    => 'post',\n        'hook'     => 'Testhookpost::do_the_thing',\n        'exectype' => 'module',\n    };\n  \n    return [ $my_add ];\n}\n  \nsub do_the_thing {\n    my ( $context, $data ) = @_;               \n   \n    my $filename = '\/var\/cpanel\/hooks_test_log_post';\n \n    open HANDLE, \">>$filename\" or die \"touch $filename: $!\\n\"; \n    close HANDLE; \n\n    my $result  = 1;\n    my $message = 'OK';\n     \n    return $result, $message;\n}\n  \n1;<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Then, you would use\u00a0the manage_hooks utility<\/a>\u00a0to register that hook:<\/p>\n\n\n\n
\n
bin\/manage_hooks add script \/usr\/local\/cpanel\/3rdparty\/bin\/testhookpost.pm<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

In addition to the SSL certificate installation hook, we’ve also created an AutoSSL certificate installation hook.<\/p>\n

Twice the fun, and twice the power!<\/h2>\n

These new hooks join the family of our other fine Standardized Hooks that you’ve come to know, love, and rely upon.<\/p>\n

For more information, read our delicious\u00a0Standardized Hook SSL documentation<\/a>.<\/p>\n


\n

A note from benny: <\/em><\/span><\/p>\n

Ready to give it a try? This feature is already available to any server with a supported version of cPanel & WHM. You can also join us in our slack<\/a> or discord<\/a> channels, post your questions on the cPanel forums<\/a> or subreddit<\/a>, or come visit Houston, Texas for the 2018 cPanel Conference<\/a>, October 1st – 3rd.\u00a0<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"

Hello, all you lovely people out in third-party developerland! Don’t you hate it when you’re installing an SSL certificate through a script or API calls, but there’s some action that you want to take before or after the installation? Well, thanks to the hardworking folks on the Development Team,\u00a0cPanel & WHM Version\u00a0now includes a Standardized […]<\/p>\n","protected":false},"author":77,"featured_media":64977,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[61],"tags":[349,833,2093,2097],"class_list":["post-49697","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tips-and-tricks","tag-hooks","tag-integration","tag-software-developers","tag-ssl-hooks"],"acf":[],"yoast_head":"\nNew SSL Standard Hooks for cPanel & WHM Integrators! | cPanel<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"New SSL Standard Hooks for cPanel & WHM Integrators! | cPanel\" \/>\n<meta property=\"og:description\" content=\"Hello, all you lovely people out in third-party developerland! Don’t you hate it when you’re installing an SSL certificate through a script or API calls, but there’s some action that you want to take before or after the installation? Well, thanks to the hardworking folks on the Development Team,\u00a0cPanel & WHM Version\u00a0now includes a Standardized […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/\" \/>\n<meta property=\"og:site_name\" content=\"cPanel\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cpanel\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-21T18:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/devel.www.cpanel.net\/wp-content\/uploads\/2018\/06\/2018.06.21.sslhooks.png\" \/>\n\t<meta property=\"og:image:width\" content=\"3858\" \/>\n\t<meta property=\"og:image:height\" content=\"1527\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"cPanel Community\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cPanel\" \/>\n<meta name=\"twitter:site\" content=\"@cPanel\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"cPanel Community\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/\",\"url\":\"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/\",\"name\":\"New SSL Standard Hooks for cPanel & WHM Integrators! | cPanel\",\"isPartOf\":{\"@id\":\"https:\/\/devel.www.cpanel.net\/#website\"},\"datePublished\":\"2018-06-21T18:00:00+00:00\",\"dateModified\":\"2018-06-21T18:00:00+00:00\",\"author\":{\"@id\":\"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/8cf97408aad4fb70cf55d11a1d4f57f8\"},\"breadcrumb\":{\"@id\":\"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/devel.www.cpanel.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"New SSL Standard Hooks for cPanel & WHM Integrators!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/devel.www.cpanel.net\/#website\",\"url\":\"https:\/\/devel.www.cpanel.net\/\",\"name\":\"cPanel\",\"description\":\"Hosting Platform of Choices\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/devel.www.cpanel.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/8cf97408aad4fb70cf55d11a1d4f57f8\",\"name\":\"cPanel Community\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e1949945083b5526bb95711bd3d616b3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e1949945083b5526bb95711bd3d616b3?s=96&d=mm&r=g\",\"caption\":\"cPanel Community\"},\"description\":\"The web hosting industry's most reliable management solution since 1997. With our first-class support and rich feature set, it's easy to see why our customers and partners make cPanel & WHM their hosting platform of choice. For more information, visit cPanel.net.\",\"sameAs\":[\"https:\/\/cpanel.net\"],\"url\":\"https:\/\/devel.www.cpanel.net\/blog\/author\/cpadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"New SSL Standard Hooks for cPanel & WHM Integrators! | cPanel","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/","og_locale":"en_US","og_type":"article","og_title":"New SSL Standard Hooks for cPanel & WHM Integrators! | cPanel","og_description":"Hello, all you lovely people out in third-party developerland! Don’t you hate it when you’re installing an SSL certificate through a script or API calls, but there’s some action that you want to take before or after the installation? Well, thanks to the hardworking folks on the Development Team,\u00a0cPanel & WHM Version\u00a0now includes a Standardized […]","og_url":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/","og_site_name":"cPanel","article_publisher":"https:\/\/www.facebook.com\/cpanel\/","article_published_time":"2018-06-21T18:00:00+00:00","og_image":[{"width":3858,"height":1527,"url":"https:\/\/devel.www.cpanel.net\/wp-content\/uploads\/2018\/06\/2018.06.21.sslhooks.png","type":"image\/png"}],"author":"cPanel Community","twitter_card":"summary_large_image","twitter_creator":"@cPanel","twitter_site":"@cPanel","twitter_misc":{"Written by":"cPanel Community","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/","url":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/","name":"New SSL Standard Hooks for cPanel & WHM Integrators! | cPanel","isPartOf":{"@id":"https:\/\/devel.www.cpanel.net\/#website"},"datePublished":"2018-06-21T18:00:00+00:00","dateModified":"2018-06-21T18:00:00+00:00","author":{"@id":"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/8cf97408aad4fb70cf55d11a1d4f57f8"},"breadcrumb":{"@id":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/new-ssl-standard-hooks-for-cpanel-whm-integrators\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/devel.www.cpanel.net\/"},{"@type":"ListItem","position":2,"name":"New SSL Standard Hooks for cPanel & WHM Integrators!"}]},{"@type":"WebSite","@id":"https:\/\/devel.www.cpanel.net\/#website","url":"https:\/\/devel.www.cpanel.net\/","name":"cPanel","description":"Hosting Platform of Choices","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/devel.www.cpanel.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/8cf97408aad4fb70cf55d11a1d4f57f8","name":"cPanel Community","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e1949945083b5526bb95711bd3d616b3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e1949945083b5526bb95711bd3d616b3?s=96&d=mm&r=g","caption":"cPanel Community"},"description":"The web hosting industry's most reliable management solution since 1997. With our first-class support and rich feature set, it's easy to see why our customers and partners make cPanel & WHM their hosting platform of choice. For more information, visit cPanel.net.","sameAs":["https:\/\/cpanel.net"],"url":"https:\/\/devel.www.cpanel.net\/blog\/author\/cpadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/posts\/49697"}],"collection":[{"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/comments?post=49697"}],"version-history":[{"count":0,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/posts\/49697\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/media\/64977"}],"wp:attachment":[{"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/media?parent=49697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/categories?post=49697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/tags?post=49697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}