SSL Unknown Protocol Error - Elektron WebSocket API - executing market_price_edpgw_authentication.py
Executing market_price_edpgw_authentication.py python code after creating AWS EC2 instance using Refinitiv AMI. Getting the below error.
('Sending authentication request with password to', 'https://api.refinitiv.com:443/auth/oauth2/beta1/token', '...')
EDP-GW Authentication succeeded. RECEIVED:
{
"access_token":"<access token>",
"expires_in":"300",
"refresh_token":"438e85ed-3a10-42d5-b07c-e49a1a3d0525",
"scope":"trapi.data.average-volume-analytics.ava_read trapi.data.historical-pricing.events.read trapi.data.historical-pricing.summaries.read trapi.data.quantitative-analytics.read trapi.messenger trapi.sdbold trapi.search.lookup.read trapi.search.metadata.read trapi.search.read trapi.user-framework.mobile.crud trapi.user-framework.recently-used.crud trapi.user-framework.workspace.crud",
"token_type":"Bearer"
}
Connecting to WebSocket wss://ec2-13-234-31-251.ap-south-1.compute.amazonaws.com:22/WebSocket ...
[SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:727)
WebSocket Closed
Best Answer
-
ec2-13-234-31-251.ap-south-1.compute.amazonaws.com looks like to be a hostname of your AWS EC2 machine. To run market_price_edpgw_authentication.py, you need to specify the hostname of the EDP-RT machine. It looks like amer-1.pricing.streaming.edp.thomsonreuters.com and the TCP port is 443.
Otherwise, you can use the market_price_edpgw_service_discovery.py example. For more information, please refer to the following links:
1
Answers
-
Hello @Sundeep.Tariyal
It seems that your are trying to connect to the server which may not support WebSocket transport; ec2-13-234-31-251.ap-south-1.compute.amazonaws.com and port 22.
You can find WebSocket host and port by running market_price_edpgw_service_discovery.py. The output is service discovery in each region that you should be able to connected to.
1 -
Pimchaya.Wongrukunjirapongse.phuriphanvichai
I tried to get hostname and port using service discovery example but ran into an error. I am using AWS free tier account and Refinitiv AMI, so I suppose I should have permission for real time streaming.
"refresh_token":"b43c8b7e-948e-4664-8306-235d86dbd8ac",
"scope":"trapi.data.average-volume-analytics.ava_read trapi.data.historical-pricing.events.read trapi.data.historical-pricing.summaries.read trapi.data.quantitative-analytics.read trapi.messenger trapi.sdbold trapi.search.lookup.read trapi.search.metadata.read trapi.search.read trapi.user-framework.mobile.crud trapi.user-framework.recently-used.crud trapi.user-framework.workspace.crud",
"token_type":"Bearer"
}
Sending EDP-GW service discovery request to https://api.refinitiv.com/streaming/pricing/v1/
('EDP-GW service discovery HTTP code:', 403, 'Forbidden')
Stop trying with the request
Failed to retrieve endpoints from EDP Service Discovery. Exiting...
0 -
I tried to get hostname and port using service discovery example but ran into an error. I am using AWS free tier account and Refinitiv AMI, so I suppose I should have permission for real time streaming.
"refresh_token":"b43c8b7e-948e-4664-8306-235d86dbd8ac",
"scope":"trapi.data.average-volume-analytics.ava_read trapi.data.historical-pricing.events.read trapi.data.historical-pricing.summaries.read trapi.data.quantitative-analytics.read trapi.messenger trapi.sdbold trapi.search.lookup.read trapi.search.metadata.read trapi.search.read trapi.user-framework.mobile.crud trapi.user-framework.recently-used.crud trapi.user-framework.workspace.crud",
"token_type":"Bearer"
}
Sending EDP-GW service discovery request to https://api.refinitiv.com/streaming/pricing/v1/
('EDP-GW service discovery HTTP code:', 403, 'Forbidden')
Stop trying with the request
Failed to retrieve endpoints from EDP Service Discovery. Exiting...
0 -
I tried to get hostname and port using service discovery example but ran into an error. I am using AWS free tier account and Refinitiv AMI, so I suppose I should have permission for real time streaming.
"refresh_token":"b43c8b7e-948e-4664-8306-235d86dbd8ac",
"scope":"trapi.data.average-volume-analytics.ava_read trapi.data.historical-pricing.events.read trapi.data.historical-pricing.summaries.read trapi.data.quantitative-analytics.read trapi.messenger trapi.sdbold trapi.search.lookup.read trapi.search.metadata.read trapi.search.read trapi.user-framework.mobile.crud trapi.user-framework.recently-used.crud trapi.user-framework.workspace.crud",
"token_type":"Bearer"
}
Sending EDP-GW service discovery request to https://api.refinitiv.com/streaming/pricing/v1/
('EDP-GW service discovery HTTP code:', 403, 'Forbidden')
Stop trying with the request
Failed to retrieve endpoints from EDP Service Discovery. Exiting...
0 -
Hello Sundeep
According to the error 403, 'Forbidden', it is possible that you may not have permission to access https://api.refinitiv.com/streaming/pricing/v1/
1 -
Thanks Pimchaya
I tried the other one (https://api.refinitiv.com/streaming/pricing/beta1/) and getting this error. This is even though I am using region = 'apac'
Sending EDP-GW service discovery request to https://api.refinitiv.com/streaming/pricing/beta1/
EDP-GW Service discovery succeeded. RECEIVED:
{
"service":[
{
"dataFormat":[
"tr_json2"
],
"endpoint":"amer-3.pricing.streaming.edp.thomsonreuters.com",
"location":[
"us-east-1a",
"us-east-1b"
],
"port":443,
"provider":"aws",
"transport":"websocket"
},
{
"dataFormat":[
"tr_json2"
],
"endpoint":"amer-2.pricing.streaming.edp.thomsonreuters.com",
"location":[
"us-east-1b"
],
"port":443,
"provider":"aws",
"transport":"websocket"
},
{
"dataFormat":[
"tr_json2"
],
"endpoint":"amer-1.pricing.streaming.edp.thomsonreuters.com",
"location":[
"us-east-1a"
],
"port":443,
"provider":"aws",
"transport":"websocket"
}
]
}
Traceback (most recent call last):
File "market_price_edpgw_service_discovery.py", line 400, in <module>
if not query_service_discovery():
File "market_price_edpgw_service_discovery.py", line 203, in query_service_discovery
for index in range(len(response_json['services'])):
KeyError: 'services'
0 -
Hello @Sundeep.Tariyal
Please post your new questions as a separate question. When the answer of this post is accepted, marked as "correct", the community tends to only look at the accepted answer and may miss your new questions on the same topic. Posting the new questions on a separate page allows everyone can see the questions and can post answers to help you.
0 -
https://api.refinitiv.com/streaming/pricing/v1/ uses "services" as a key.
{
"services": [
{
"port": 14002,
"location": [
"eu-west-1b"On the other hand, https://api.refinitiv.com/streaming/pricing/beta1/ uses "service" as a key.
{
"service": [
{
"port": 14002,
"location": [
"us-east-1a",
"us-east-1b"
],You need to use https://api.refinitiv.com/streaming/pricing/v1/ instead of https://api.refinitiv.com/streaming/pricing/beta1/.
Otherwise, you need to modify the code to use "service" instead.
File "market_price_edpgw_service_discovery.py", line 203, in query_service_discovery
for index in range(len(response_json['services'])):
If you have any further questions, feel free to submit a new question in the forum.
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 368 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛