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

InsecureRequest errors for magpic and image_cutouts.first #2345

Closed
bsipocz opened this issue Mar 29, 2022 · 0 comments
Closed

InsecureRequest errors for magpic and image_cutouts.first #2345

bsipocz opened this issue Mar 29, 2022 · 0 comments

Comments

@bsipocz
Copy link
Member

bsipocz commented Mar 29, 2022

cc @keflavich

Could you have a look at this, and whether we can do anything about the URL for these two modules? You can reproduce by running the remote tests for them (I've included one as an example below).

urllib3.exceptions.InsecureRequestWarning: Unverified HTTPS request is being made to host 'third.ucllnl.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
________________________________________________________________________ TestFirst.test_get_images_async ________________________________________________________________________

self = <astroquery.image_cutouts.first.tests.test_first_remote.TestFirst object at 0x152fc9970>

    def test_get_images_async(self):
>       response = first.core.First.get_images_async(
            SkyCoord(162.530, 30.677, unit=(u.deg, u.deg), frame='icrs'),
            image_size='1 arcmin')

astroquery/image_cutouts/first/tests/test_first_remote.py:14: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
astroquery/image_cutouts/first/core.py:90: in get_images_async
    response = self._request("POST", url=self.URL, data=request_payload,
astroquery/query.py:317: in _request
    response = query.request(self._session,
astroquery/query.py:71: in request
    return session.request(self.method, self.url, params=self.params,
/Users/bsipocz/.pyenv/versions/3.9.1/lib/python3.9/site-packages/requests/sessions.py:542: in request
    resp = self.send(prep, **send_kwargs)
/Users/bsipocz/.pyenv/versions/3.9.1/lib/python3.9/site-packages/requests/sessions.py:655: in send
    r = adapter.send(request, **kwargs)
/Users/bsipocz/.pyenv/versions/3.9.1/lib/python3.9/site-packages/requests/adapters.py:439: in send
    resp = conn.urlopen(
/Users/bsipocz/.pyenv/versions/3.9.1/lib/python3.9/site-packages/urllib3/connectionpool.py:699: in urlopen
    httplib_response = self._make_request(
/Users/bsipocz/.pyenv/versions/3.9.1/lib/python3.9/site-packages/urllib3/connectionpool.py:382: in _make_request
    self._validate_conn(conn)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib3.connectionpool.HTTPSConnectionPool object at 0x152fc9be0>, conn = <urllib3.connection.HTTPSConnection object at 0x14d049c40>

    def _validate_conn(self, conn):
        """
        Called right before a request is made, after the socket is created.
        """
        super(HTTPSConnectionPool, self)._validate_conn(conn)
    
        # Force connect early to allow us to validate the connection.
        if not getattr(conn, "sock", None):  # AppEngine might not have  `.sock`
            conn.connect()
    
        if not conn.is_verified:
>           warnings.warn(
                (
                    "Unverified HTTPS request is being made to host '%s'. "
                    "Adding certificate verification is strongly advised. See: "
                    "https://urllib3.readthedocs.io/en/latest/advanced-usage.html"
                    "#ssl-warnings" % conn.host
                ),
                InsecureRequestWarning,
            )
E           urllib3.exceptions.InsecureRequestWarning: Unverified HTTPS request is being made to host 'third.ucllnl.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

/Users/bsipocz/.pyenv/versions/3.9.1/lib/python3.9/site-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning
___________________________________________________________________________ TestFirst.test_get_images ___________________________________________________________________________

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

No branches or pull requests

1 participant