Loading TOC...

MarkLogic 12 EA 1 Product Documentation
admin.appserverSetSslClientCertificateAuthorities

admin.appserverSetSslClientCertificateAuthorities(
   config as element(configuration),
   appserver-id as (Number|String),
   value as (Number|String)[]
) as element(configuration)

Summary

This function sets one or more client certificate authorities that sign client certificates for the specified App Server. This function is typically used along with the pki.insertTrustedCertificates and pki.getTrustedCertificateIds functions to import trusted Certificate Authorities for client certificates.

Parameters
config A configuration specification, typically as returned from one of the Admin module functions.
appserver-id The ID of the App Server. Typically, this is the result of an admin.appserverGetId call.
value One or more ids for trusted certificates generated by the certificate authority to be set.

Required Privileges

This operation requires at least one of the following privileges:

http://marklogic.com/xdmp/privileges/admin/app-server-security

http://marklogic.com/xdmp/privileges/admin/app-server-security/{id}

http://marklogic.com/xdmp/privileges/admin/group-security

http://marklogic.com/xdmp/privileges/admin/group-security/{id}

Example


  let pki = require("/MarkLogic/pki.xqy")
  let admin = require("/MarkLogic/admin.xqy")

  let config = admin.getConfiguration()
  let groupid = admin.groupGetId(config, "Default")
  let appservid = admin.appserverGetId(config, groupid, "myAppServer")

  let certId = []
  for(let cert of pki.getCertificates(pki.getTrustedCertificateIds()).toObject())
    if(cert.xpath("x509:cert/x509:subject/x509:commonName/text()",{"x509":"http://marklogic.com/xdmp/x509"}) == 'Acme Certificate Authority' &&
        cert.xpath("x509:cert/x509:subject/x509:organizationName/text()",{"x509":"http://marklogic.com/xdmp/x509"}) == 'Acme Corporatio')
      certId.push(cert.xpath("pki:certificate-id"))
      
  admin.appserverSetSslClientCertificateAuthorities(
	config,
  appservid,
	certId)
     

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.