Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
x509check allow read cert from file (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 committed Mar 19, 2019
1 parent d7b740c commit d1bc033
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/go.d/x509check.conf
Expand Up @@ -53,7 +53,7 @@
#
# [ List of JOB specific parameters ]:
# - source
# Certificate source. Allowed schemes: https, tcp, tcp4, tcp6, udp, udp4, udp6.
# Certificate source. Allowed schemes: https, tcp, tcp4, tcp6, udp, udp4, udp6, file.
# Syntax:
# source: https://example.org:443
#
Expand Down
3 changes: 3 additions & 0 deletions modules/x509check/README.md
Expand Up @@ -21,4 +21,7 @@ jobs:

- name: my_site_org
source: https://my_site_org:443

- name: my_local_cert
source: file:///home/me/cert.pem
```
7 changes: 3 additions & 4 deletions modules/x509check/cert_getter.go
Expand Up @@ -15,7 +15,7 @@ import (
)

var supportedSchemes = []string{
//"file",
"file",
"https",
"tcp",
"tcp4",
Expand All @@ -37,9 +37,8 @@ func newCertGetter(config Config) (certGetter, error) {
}

switch u.Scheme {
// TODO: not tested
//case "file":
// return newFileCertGetter(u.Path), nil
case "file":
return newFileCertGetter(u.Path), nil
case "https":
u.Scheme = "tcp"
fallthrough
Expand Down

0 comments on commit d1bc033

Please sign in to comment.