rbw / aiosnow

Asynchronous ServiceNow Library
MIT License
73 stars 12 forks source link

Cannot connect to host https:443 #66

Closed trosos closed 4 years ago

trosos commented 4 years ago

Example in the file create-update-delete.py suggests instantiating snow.Application like

app = Application(
    dict(
        address="https://<instance_name>.service-now.com",
        basic_auth=("<username>", "<password>")
    )
)

However, in my environment this fails with

snow.exceptions.ClientConnectionError: Cannot connect to host https:443 ssl:default [Name or service not known]

when awaiting on r.create.

To fix this, I needed to change the code not to contain the https url scheme:

app = Application(
    dict(
        address="<instance_name>.service-now.com",
        basic_auth=("<username>", "<password>")
    )
)

I may look deeper into this if needed.

rbw commented 4 years ago

This was changed after use_ssl and verify_ssl was introduced. If use_ssl is set to false, the http scheme is prepended to address, otherwise https. I realize now that I haven't updated the examples to reflect this.

Perhaps the old format of scheme + authority (host+port) would be clearer? What do you think?

trosos commented 4 years ago

I have no strict opinion on this.

(Except that partial (zero-path without explicit slash) URIs like http://example.com look awkward to me; so personally, I like the current solution more and vote for updating of the examples.)