zpm.scriptā¢708 B
set $namespace="%SYS"
set name="DefaultSSL"
do:'##class(Security.SSLConfigs).Exists(name) ##class(Security.SSLConfigs).Create(name)
set url="https://pm.community.intersystems.com/packages/zpm/latest/installer"
Do ##class(%Net.URLParser).Parse(url,.comp)
set ht = ##class(%Net.HttpRequest).%New()
set ht.Server = comp("host")
set ht.Port = 443
set ht.Https=1
set ht.SSLConfiguration=name
set st=ht.Get(comp("path"))
if 'st { w $System.Status.GetErrorText(st) q }
set xml=##class(%File).TempFilename("xml"), tFile = ##class(%Stream.FileBinary).%New(), tFile.Filename = xml
do tFile.CopyFromAndSave(ht.HttpResponse.Data)
do ht.%Close(), $system.OBJ.Load(xml,"ck")
do ##class(%File).Delete(xml)