API connection error
ebeullard opened this issue · 3 comments
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.get_prices()
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.
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.
fwiw you may be able to fix this using pip install --upgrade certifi
(certificate issues are always a pain though...)