go-syslog
go-syslog copied to clipboard
Fixes unit tests under go 1.16, fix for UTC timestamp parsing, adds go modules support
Unit test fixes
The unit tests, at least under go 1.16, were failing:
panic: x509: certificate relies on legacy Common Name field, use SANs or temporarily enable Common Name matching with GODEBUG=x509ignoreCN=0
I put in new certificates, separating the client from the server certificate. The server certificate now has a subject alternative name section which includes both localhost
and 127.0.0.1
.
Timestamp parsing fixes
RFC 3339 timestamps do not have a fixed size length, but they also do not contain any spaces: https://tools.ietf.org/html/rfc3339#section-5.8
I changed the code to terminate after the first space instead using the size of the formatting string to fix the issue.
Go modules support
Added go modules support.
If you are not happy with something or want something done better, let me know and I'll try to fix it.