Skip to content

time.RFC3339Nano Precision is high ONLY in linux and its causing 401 unauthorised, when forming Digest Auth Security xml #51

@chaymankala

Description

@chaymankala

In gosoap/ws-security.go
In func NewSecurity

created := time.Now().UTC().Format(time.RFC3339Nano)

Output in mac
2024-08-08T10:05:42.785935Z

Output in linux
2024-08-08T10:06:17.763359929Z

In the Linux output, the time is formatted using a higher level of precision, including 9 digits after the decimal point, representing nanoseconds.

Because of this, when I try connecting to my Hikvision Camera/DVR, it is throwing 401 unauthorised error.
When I changed the code to
created := time.Now().UTC().Format(time.RFC3339) // removed Nano
It started working fine.

Please fix this issue, so that it works everywhere.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions