Loading TOC...

admin.foreignClusterSetSslCertificate

admin.foreignClusterSetSslCertificate(
   config as element(configuration),
   cluster-id as (Number|String),
   ssl-certificate as String?
) as element(configuration)

Summary

This function sets the specified SSL certificate for secure communication with hosts in a foreign cluster. This certificate is shared by all hosts in the cluster when communicating with foreign hosts.

Parameters
config A configuration specification, typically as returned from one of the Admin module functions.
cluster-id The ID of the foreign cluster.
ssl-certificate The SSL certificate returned by the admin:cluster-get-xdqp-ssl-certificate function on the foreign cluster.

Required Privileges

http://marklogic.com/xdmp/privileges/admin/cluster

Example

  
  const admin = require('/MarkLogic/admin.xqy');
  const cfg = admin.getConfiguration()
  const fcl = admin.clusterGetForeignClusterId(cfg, "ClusterA")
  const cert = "---BEGIN CERTIFICATE-----\
               MIICzjCCAbagAwIBAgIJAMieG0IJQAWQMA0GCSqGSIb3DQEBBQUAMB8xHTAbBgNV\
               BAMTFDE3MDY0ODkwODY2NTc0NzgxNTcxMB4XDTExMDYwMjIwMjA1M1oXDTIxMDUz\
               MDIwMjA1M1owHzEdMBsGA1UEAxMUMTcwNjQ4OTA4NjY1NzQ3ODE1NzEwggEiMA0G\
               CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDPM9XLSbmVN1Fykz523I7H9Cq4zgO9\
               cUSHI/FArYnWNXUbJIesvDifu2DggfsE7HD6Glwa1ZvkVTBDyZhYv1MZMpBy18Au\
               9McoBbl9NYHOIhtM6bHTJAWNDoHi+TL/rFJzxo5h+bC/JnOjbE40MZKkzSzV944t\
               LbpYT3JfGtMJgcCEWqVLp7vkSRUsKCPuJdPpFfMixDaLA75+W9PVdm01jDvihrgr\
               CZkVjlMzZersHYQDsuNNWwt/9fM1skKabVWUVB0vHV307j2JHwVUJS3+hVxSiT61\
               GaIO3GSL6dVI5ZlYZCCyyFNc0cqPutu0Q3MfZq6MpFlt5Iffm0cWwSkvAgMBAAGj\
               DTALMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQEFBQADggEBAIKRSFrk3a7JBl9bBsBb\
               sWxob3eVM4wh8f6EPjdiIZL0V7HH4dH2hdcvtXB0NdMntiTeJfjm/tdzzMMS0al/\
               LZV3BxxMa7vYk6JtRFUaMdMwwsSa319n2WXKHlqZksWk4H5gC8AH5Vpdex44SKP4\
               GYVh0MO5kIS07yHfuv66PWsTRQiIHQSHYe33Dot/Mfs9BT/sVm1qRJ1ZO5GAf136\
               3iQhwf8fa0PdYGfmN9I1yQMneet3W3k9T4J86mp4RuYl44Z0sv1p3oDCcuiVRgbF\
               ro0dL8n7gE6fW8Hj5tnZQxYzFCwUqy8nhab+MwpOsoACOM8WvULnaMgPdflEklQT\
               VL0=\
               ----END CERTIFICATE-----"
  admin.foreignClusterSetSslCertificate(cfg, fcl, cert)

   //Sets the SSL certificate for communication with the foreign cluster. Use
   //admin.saveConfiguration to save the changes to the configuration or pass
   //the configuration to other Admin API functions to make other changes. 
    

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