Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move from MQTT topics being configureable to not. #55

Open
johanix opened this issue Aug 30, 2024 · 0 comments
Open

Move from MQTT topics being configureable to not. #55

johanix opened this issue Aug 30, 2024 · 0 comments

Comments

@johanix
Copy link
Collaborator

johanix commented Aug 30, 2024

There is lot's of opportunity to get the topics wrong as long as they are configurable. In particular, as part of the topic name often has to match the cert CN, it seems like it would be better to create the topic internally and not have that as a set of config options.

For the particular case of the CN, this is how to extract it from the cert:

// Parse the certificate
cert, err := x509.ParseCertificate(block.Bytes)
if err != nil {
    log.Fatalf("failed to parse certificate: %v", err)
}

// Extract the Common Name (CN)
cn := cert.Subject.CommonName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant