Created
January 28, 2016 12:25
-
-
Save ableasdale/8180ee02c0df28123cb7 to your computer and use it in GitHub Desktop.
Associate an installed certificate with a MarkLogic Application Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xquery version "1.0-ml"; | |
| import module namespace pki = "http://marklogic.com/xdmp/pki" at "/MarkLogic/pki.xqy"; | |
| import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
| declare namespace x509 = "http://marklogic.com/xdmp/x509"; | |
| let $config := admin:get-configuration() | |
| let $groupid := admin:group-get-id($config, "Default") | |
| let $appservid := admin:appserver-get-id($config, $groupid, "DemoAppServer") | |
| let $cert-id := for $cert in pki:get-certificates(pki:get-trusted-certificate-ids()) | |
| where $cert/x509:cert/x509:subject/x509:commonName eq "DemoLab CA" | |
| return fn:data($cert/pki:certificate-id) | |
| let $spec := admin:appserver-set-ssl-client-certificate-authorities($config, $appservid, $cert-id) | |
| return admin:save-configuration($spec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment