pyth-network / pyth-client

Client API for on-chain pyth programs
https://pyth.network
Apache License 2.0
169 stars 102 forks source link

API connection error #176

Closed ebeullard closed 2 years ago

ebeullard commented 2 years ago

after connecting without issue for about a month, I am now getting the following error: ClientConnectorCertificateError: Cannot connect to host api.devnet.solana.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')]

The snippet presented in github was used to test the connection but the error remains: from pythclient.pythclient import PythClient from pythclient.pythaccounts import PythPriceAccount from pythclient.utils import get_key

solana_network="devnet" async with PythClient( first_mapping_account_key=get_key(solana_network, "mapping"), program_key=get_key(solana_network, "program") if use_program else None, ) as c: await c.refresh_all_prices() products = await c.get_products() for p in products: print(p.attrs) prices = await p.getprices() for , pr in prices.items(): print( pr.price_type, pr.aggregate_price_status, pr.aggregate_price, "p/m", pr.aggregate_price_confidence_interval, )

I am running python 3.10 at the moment.

jayantk commented 2 years ago

This is an SSL error -- it looks like you don't have the necessary certificates required for your computer to securely query the devnet solana host.

Closing because this is not a pyth-client problem.

jayantk commented 2 years ago

fwiw you may be able to fix this using pip install --upgrade certifi

(certificate issues are always a pain though...)

ebeullard commented 2 years ago

Hi,

I tried the below but no success ( I was running certifi 2022.5.18 and it worked for a few weeks). Would you have any other pointer?

regards

From: Jayant Krishnamurthy @.> Sent: 15 June 2022 18:33 To: pyth-network/pyth-client @.> Cc: Eddy Beullard @.>; Author @.> Subject: Re: [pyth-network/pyth-client] API connection error (Issue #176)

fwiw you may be able to fix this using pip install --upgrade certifi

— Reply to this email directly, view it on GitHubhttps://github.com/pyth-network/pyth-client/issues/176#issuecomment-1156747709, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZUNW7ULLAQU7QMAFRTPWU3VPIHTRANCNFSM5Y2FQCIA. You are receiving this because you authored the thread.Message ID: @.**@.>>

Tibra Trading Europe Limited is Authorised and Regulated by the FCA (Company No. 06061713) Tibra Global Services Pty Limited London Branch (Company No. BR014370) Tibra Equities Europe Limited (Company No. 07283912) Registered in England & Wales - Level 11, 5 Aldermanbury Square London EC2V 7HR

Unless otherwise stated, this communication is neither an offer nor solicitation of an offer to sell or purchase any investment

The contents of this email including any attachments are confidential. If you have received this email in error, please advise the sender by return email and delete this email. Any unauthorised use of the contents of the email is prohibited and you must not disseminate, copy or distribute the message or use the information contained in the email or its attachments in any way.

The views or opinions expressed are the author's own and may not reflect the views or opinions of Tibra. Tibra does not guarantee the integrity of any emails or attached files. E-mails may be interfered with, may contain computer viruses or other defects. Under no circumstances do we accept liability for any loss or damage which may result from your receipt of this message or any attachments. Nothing in this communication should be deemed to bind the individual sender or Tibra entity to any contract or other undertaking. If your underlying email contained any intellectual property or other information, you are deemed to have waived any rights to it if it was sent on an unsolicited basis.