mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-12 21:35:40 +08:00
Include certificate in enrollment profile and use PEM certificate payload type (#116)
This commit is contained in:
@@ -131,7 +131,7 @@ func (svc service) Enroll(ctx context.Context) (Profile, error) {
|
||||
|
||||
// Client needs to trust us at this point if we are using a self signed certificate.
|
||||
if len(svc.TLSCert) > 0 {
|
||||
tlsPayload := NewPayload("com.apple.security.pkcs1")
|
||||
tlsPayload := NewPayload("com.apple.security.pem")
|
||||
tlsPayload.PayloadDisplayName = "Self-signed TLS certificate for MicroMDM"
|
||||
tlsPayload.PayloadDescription = "Installs the TLS certificate for MicroMDM"
|
||||
tlsPayload.PayloadIdentifier = "com.github.micromdm.tls"
|
||||
|
||||
5
serve.go
5
serve.go
@@ -107,6 +107,7 @@ func serve(args []string) error {
|
||||
APNSPrivateKeyPass: *flAPNSKeyPass,
|
||||
APNSPrivateKeyPath: *flAPNSKeyPath,
|
||||
depsim: *flDepSim,
|
||||
tlsCertPath: *flTLSCert,
|
||||
}
|
||||
if err := os.MkdirAll(configDBPath, 0755); err != nil {
|
||||
return errors.Wrapf(err, "creating config directory %s", configDBPath)
|
||||
@@ -320,6 +321,7 @@ type config struct {
|
||||
APNSPrivateKeyPath string
|
||||
APNSCertificatePath string
|
||||
APNSPrivateKeyPass string
|
||||
tlsCertPath string
|
||||
|
||||
PushService *push.Service // bufford push
|
||||
pushService *nanopush.Push
|
||||
@@ -488,7 +490,6 @@ func (c *config) setupEnrollmentService() {
|
||||
}
|
||||
SCEPRemoteURL := strings.TrimRight(c.ServerPublicURL, "/") + "/scep"
|
||||
|
||||
var tlsCert string
|
||||
var SCEPCertificateSubject string
|
||||
// TODO: clean up order of inputs. Maybe pass *SCEPConfig as an arg?
|
||||
// but if you do, the packages are coupled, better not.
|
||||
@@ -498,7 +499,7 @@ func (c *config) setupEnrollmentService() {
|
||||
SCEPRemoteURL,
|
||||
c.SCEPChallenge,
|
||||
c.ServerPublicURL,
|
||||
tlsCert,
|
||||
c.tlsCertPath,
|
||||
SCEPCertificateSubject,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user