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

Azure Authentication broken #418

Closed
annerajb opened this issue Aug 9, 2017 · 12 comments
Closed

Azure Authentication broken #418

annerajb opened this issue Aug 9, 2017 · 12 comments

Comments

@annerajb
Copy link

annerajb commented Aug 9, 2017

When trying to use azure dns it fails with the following:

Error: autorest/azure: Service returned an error. Status=401 Code="AuthenticationFailed" Message="Authentication failed. The 'Authorization' header is missing.""

Any ideas @buckett @xenolf ?

@xenolf
Copy link
Member

xenolf commented Aug 10, 2017

Could you try updating the azure dependency?

@annerajb
Copy link
Author

annerajb commented Aug 10, 2017 via email

@mholt
Copy link
Contributor

mholt commented Aug 10, 2017

Run go get -u github.com/Azure/azure-sdk-for-go and go get -u github.com/Azure/go-autorest

@annerajb
Copy link
Author

Thanks I think that was the issue the vendored versions where too old
for reference: janeczku/rancher-letsencrypt#90

@mholt mholt closed this as completed Aug 11, 2017
@skuda
Copy link

skuda commented Aug 17, 2017

Hi,

I don't know too much about golang so maybe I am doing something wrong, but I am not able to fix that problem with go get -u github.com/Azure/azure-sdk-for-go and go get -u github.com/Azure/go-autorest.

I tried this:

skuda@skuda ~/go/src/github.com/xenolf/lego (master) $ go get -u github.com/Azure/azure-sdk-for-go
package github.com/Azure/azure-sdk-for-go: no buildable Go source files in /home/skuda/go/src/github.com/Azure/azure-sdk-for-go

skuda@skuda ~/go/src/github.com/xenolf/lego (master) $ go get -u github.com/Azure/go-autorest
package github.com/Azure/go-autorest: no buildable Go source files in /home/skuda/go/src/github.com/Azure/go-autorest

skuda@skuda ~/go/src/github.com/xenolf/lego (master) $ go clean .
skuda@skuda ~/go/src/github.com/xenolf/lego (master) $ go build -a -o /tmp/lego .

skuda@skuda ~/go/src/github.com/xenolf/lego (master) $ /tmp/lego --email [email protected] --domains www.example.com --dns azure run
2017/08/17 20:35:04 [INFO][www.example.com] acme: Obtaining bundled SAN certificate
2017/08/17 20:35:06 [INFO][www.example.com] AuthURL: https://acme-v01.api.letsencrypt.org/acme/authz/7n3h3UiLQhnjYnV33455O3NEmzkn-T6JDLXXCC5IvAU
2017/08/17 20:35:06 [INFO][www.example.com] acme: Could not find solver for: http-01
2017/08/17 20:35:06 [INFO][www.example.com] acme: Could not find solver for: tls-sni-01
2017/08/17 20:35:06 [INFO][www.example.com] acme: Trying to solve DNS-01
2017/08/17 20:35:07 [www.example.com] Could not obtain certificates
	Error presenting token: dns.ZonesClient#Get: Failure responding to request: StatusCode=401 -- Original Error: autorest/azure: Service returned an error. Status=401 Code="AuthenticationFailed" Message="Authentication failed. The 'Authorization' header is missing."

How should I compile lego to be able to use it with Azure DNS? Thanks!

@annerajb
Copy link
Author

you are not alone.
i forgot to update this.
after building a new image that actually included the latest lego it still didn't work.

@tamalsaha
Copy link

@skuda , you need to keep these libraries in sync, not necessarily at master. You can find the matching versions from azure sdk's Github release page. https://github.com/Azure/azure-sdk-for-go/releases

@annerajb
Copy link
Author

I verified and they are synced to the glide.lock of azure-sdk-for-go repository.
I tested it using the Dockerfile and passing my azure arguments.

@skuda
Copy link

skuda commented Aug 23, 2017

@tamalsaha , thank you but I can't get it to work, I tried using version listed here https://github.com/Azure/azure-sdk-for-go/blob/v10.2.1-beta/glide.lock and versions listed here https://github.com/annerajb/rancher-letsencrypt/blob/a324355884ac08223409ffbe31854510c905c06d/vendor.conf

I can't get any of those to work, I always get the same error, if someone knows what tags should I be using please let me know!

@kisamoto
Copy link

kisamoto commented Sep 25, 2017

Can confirm this is still an issue in release lego version 0.4.0 installed via Homebrew.
Have tried the above steps to build with latest versions of Azure/azure-sdk-for-go and Azure/go-autorest but to no avail. Does anybody have any ideas?

Edit

Also tried using the tags from annerajb/rancher-letsencrypt vendor.conf file (listed below) but still getting same error.

vendor.conf

github.com/aws/aws-sdk-go							v1.8.6
github.com/Azure/azure-sdk-for-go					v10.2.1-beta
github.com/Azure/go-autorest						0545944

Tried with github.com/xenolf/lego checked out to:

  • master
  • tag v0.4.0
  • commit aaa8e70 from the above vendor.conf

All versions fail with error:

2017/09/25 14:09:10 [www.example.com] Could not obtain certificates
        Error presenting token: dns.ZonesClient#Get: Failure responding to request: StatusCode=401 -- Original Error: autorest/azure: Service returned an error. Status=401 Code="AuthenticationFailed" Message="Authentication failed. The 'Authorization' header is missing."

@xenolf
Copy link
Member

xenolf commented Sep 25, 2017

This should be fixed now. Could you verify the fix in current master before I push a new release?

@kisamoto
Copy link

@xenolf can confirm fix on current master (330458372443df416615174dab032ca417cba382) using master branches of Azure services works.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants