We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ebc003d commit 1475cf6Copy full SHA for 1475cf6
cmd/cloudflared/tunnel/subcommand_context.go
@@ -120,6 +120,12 @@ func (sc *subcommandContext) readTunnelCredentials(tunnelID uuid.UUID) (*pogs.Tu
120
121
var auth pogs.TunnelAuth
122
if err = json.Unmarshal(body, &auth); err != nil {
123
+ if strings.HasSuffix(filePath, ".pem") {
124
+ return nil, fmt.Errorf("The tunnel credentials file should be .json but you gave a .pem. "+
125
+ "The tunnel credentials file was originally created by `cloudflared tunnel create` and named %s.json."+
126
+ "You may have accidentally used the filepath to cert.pem, which is generated by `cloudflared tunnel "+
127
+ "login`.", tunnelID)
128
+ }
129
return nil, errInvalidJSONCredential{path: filePath, err: err}
130
}
131
return &auth, nil
0 commit comments