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

AutoRest: ensuring the same senders are used for auth & client requests #3301

Merged
merged 2 commits into from
Apr 25, 2019

Conversation

tombuildsstuff
Copy link
Contributor

Passing the same Sender to the Auth and Client calls

Fixes #3271

@tombuildsstuff tombuildsstuff added this to the v1.25.1 milestone Apr 23, 2019
@tombuildsstuff tombuildsstuff requested a review from a team April 23, 2019 20:02
@katbyte
Copy link
Collaborator

katbyte commented Apr 25, 2019

Verified:

hosts:

10.10.10.10     manage.windowsazure.com
10.10.10.10     management.core.windows.net
10.10.10.10     management.azure.com
10.10.10.10     login.microsoftonline.com

before (timeouts)

[19:45:14] kt@snowbook:~/hashi/tf/azure/azurerm/examples/automation-account▸f/proxy$ terraform -v
Terraform v0.11.13
+ provider.azurerm v1.25.0

[19:45:17] kt@snowbook:~/hashi/tf/azure/azurerm/examples/automation-account▸f/proxy$  terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.


Error: Error refreshing state: 1 error(s) occurred:

* provider.azurerm: Unable to list provider registration status, it is possible that this is due to invalid credentials or the service principal does not have permission to use the Resource Manager API, Azure error: azure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://management.azure.com/subscriptions/8708baf2-0a54-4bb4-905b-78d21ac150da/providers?api-version=2016-02-01: StatusCode=0 -- Original Error: adal: Failed to execute the refresh request. Error = 'Post https://login.microsoftonline.com/0e3e2e88-8caf-41ca-b4da-e3b33b6c52ec/oauth2/token?api-version=1.0: dial tcp 10.10.10.10:443: connect: operation timed out'


[19:46:38] kt@snowbook:~/hashi/tf/azure/azurerm/examples/automation-account▸f/proxy$ http_proxy=http://localhost:3128 https_proxy=http://localhost:3128 terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.


Error: Error refreshing state: 1 error(s) occurred:

* provider.azurerm: Unable to list provider registration status, it is possible that this is due to invalid credentials or the service principal does not have permission to use the Resource Manager API, Azure error: azure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://management.azure.com/subscriptions/8708baf2-0a54-4bb4-905b-78d21ac150da/providers?api-version=2016-02-01: StatusCode=0 -- Original Error: adal: Failed to execute the refresh request. Error = 'Post https://login.microsoftonline.com/0e3e2e88-8caf-41ca-b4da-e3b33b6c52ec/oauth2/token?api-version=1.0: dial tcp 10.10.10.10:443: connect: operation timed out'

after (hits proxy)

[19:50:10] kt@snowbook:~/hashi/tf/azure/azurerm/examples/automation-account▸f/proxy$ terraform -v
Terraform v0.11.13
+ provider.azurerm (unversioned)

[19:39:38] kt@snowbook:~/hashi/tf/azure/azurerm/examples/automation-account▸f/proxy$  terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.


Error: Error refreshing state: 1 error(s) occurred:

* provider.azurerm: Unable to list provider registration status, it is possible that this is due to invalid credentials or the service principal does not have permission to use the Resource Manager API, Azure error: azure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://management.azure.com/subscriptions/8708baf2-0a54-4bb4-905b-78d21ac150da/providers?api-version=2016-02-01: StatusCode=0 -- Original Error: adal: Failed to execute the refresh request. Error = 'Post https://login.microsoftonline.com/0e3e2e88-8caf-41ca-b4da-e3b33b6c52ec/oauth2/token?api-version=1.0: dial tcp 10.10.10.10:443: connect: operation timed out'

[19:38:32] kt@snowbook:~/hashi/tf/azure/azurerm/examples/automation-account▸f/proxy$ http_proxy=http://localhost:3128 https_proxy=http://localhost:3128 terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.


Error: Error refreshing state: 1 error(s) occurred:

* provider.azurerm: Unable to list provider registration status, it is possible that this is due to invalid credentials or the service principal does not have permission to use the Resource Manager API, Azure error: azure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://management.azure.com/subscriptions/8708baf2-0a54-4bb4-905b-78d21ac150da/providers?api-version=2016-02-01: StatusCode=0 -- Original Error: adal: Failed to execute the refresh request. Error = 'Post https://login.microsoftonline.com/0e3e2e88-8caf-41ca-b4da-e3b33b6c52ec/oauth2/token?api-version=1.0: x509: certificate signed by unknown authority'

(squid proxy is using untrusted CA)

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@katbyte katbyte merged commit 645ce9c into master Apr 25, 2019
@katbyte katbyte deleted the f/proxy branch April 25, 2019 02:59
katbyte added a commit that referenced this pull request Apr 25, 2019
@ghost
Copy link

ghost commented May 25, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators May 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.25.0 breaks usage of Proxy
2 participants