Question
· May 5, 2019

How to Create SSL Configuration Programmatically?

Hi Community!

How do you create SSL Configuration for InterSystems IRIS programmatically? E.g. for installation or deployment case?

E.g. if I need to create a very simple "default" SSL client configuration to let HTPPS Get requests to an arbitrary server?

Discussion (5)2
Log in or sign up to continue
ClassMethod GetSSLConfiguration(host) As %String
{
  NEW $NAMESPACE
  SET $NAMESPACE = "%SYS"
  
  IF '##class(Security.SSLConfigs).Exists(host) {
    DO ##class(Security.SSLConfigs).Create(host)
  }
  QUIT host
}

Set tRequest = ##class(%Net.HttpRequest).%New()
Set tRequest.Server = "community.intersystems.com"
Set tRequest.Https = 1
Set tRequest.SSLConfiguration = ..GetSSLConfiguration(tRequest.Server)
....