-
Notifications
You must be signed in to change notification settings - Fork 129
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
http response error: 401 - invalid content type #75
Comments
I haven't tried pywinrm yet but be sure to set the following on the server for this winrm client.
Also checkout http://www.hurryupandwait.io/blog/understanding-and-troubleshooting-winrm-connection-and-authentication-a-thrill-seekers-guide-to-adventure to help debug if the above doesn't work for you. |
I had the exact same issue. Unfortunately the error message is somewhat confusing. The status code is there, and points you in to the right direction, but the error message "invalid content type" is a bit meaningless in this case. I think the reason for the "invalid content type" message is because the body is basically empty in this particular scenario. So in http.go on line 87 we get the body and then we append this to the console message. In case of 401, the body is empty and the Body() function throws its error.I think a simple "401 - Unauthorized" message would be sufficient in this case. So, about the authentication issue. In my case the winrm set winrm/config/service '@{AllowUnencrypted="true"}' has not been set. I didn't notice the error message when I tried to configure this setting:
This is due to one of my network adapters being set to the public profile. I couldn't force it though and I didn't have time to figure out if there is a way. It seems that this exception actually prevents the setting from being configured. So you can double check it with this command:
I then used the following command to figure out which interface is configured to public.
After this, it worked for me in my lab. This is not suitable for production use though :) |
I got this error when using the API and had the wrong credentials in my |
I'm hitting this error currently, despite
Is there something obvious I'm missing? |
Got this error when I didn't have |
It's probably because the server requires NTLM authentication - I have a PR in to implement this in this repo but this seems to be not very active you could use https://github.com/CalypsoSys/bobwinrm see https://github.com/CalypsoSys/bobwinrmntlm for usage |
Getting error above on this command:
Windows has default settings, I can connect using
pywinrm
.The text was updated successfully, but these errors were encountered: