Make public facing URL and SCEP server URL configurable.

Degrade gracefully to disabling enrollment endpoint if either URL or SCEP url are not provided.
This commit is contained in:
Mosen
2016-07-01 10:24:44 +10:00
committed by Victor Vrantchan
parent 445f4d2e70
commit c15d7a9611

View File

@@ -6,7 +6,7 @@ type Service interface {
Enroll() (Profile, error)
}
func NewService(pushCertPath string, pushCertPass string, caCertPath string) (Service, error) {
func NewService(pushCertPath string, pushCertPass string, caCertPath string, url string, scepUrl string) (Service, error) {
pushTopic, err := GetPushTopicFromPKCS12(pushCertPath, pushCertPass)
if err != nil {
return nil, err
@@ -30,8 +30,8 @@ func NewService(pushCertPath string, pushCertPass string, caCertPath string) (Se
}
return &service{
Url: "https://micromdm.local:6443",
SCEPUrl: "http://micromdm.local:2019/scep",
Url: url,
SCEPUrl: scepUrl,
SCEPSubject: scepSubject,
Topic: pushTopic,
CACert: caCert,