import ssl
import socket
hostname = "example.com"
port = 443
context = ssl.create_default_context()
with socket.create_connection((hostname, port)) as sock:
with context.wrap_socket(sock, server_hostname=hostname) as sslsock:
der_cert = sslsock.getpeercert(True)
# from binary DER format to PEM
pem_cert = ssl.DER_cert_to_PEM_cert(der_cert)
print(pem_cert)
if v.ValuingData.Data.OwAvg > 3.4
package structs
type Forks []struct {
ForkID string `json:"fork_id"`
Income float64 `json:"income"`
Sport string `json:"sport"`
BetType string `json:"bet_type"`
EventID string `json:"event_id"`
BK1Bet string `json:"BK1_bet"`
BK1BetType string `json:"BK1_bet_type"`
BK1AltBet string `json:"BK1_alt_bet"`
BK1Cf float64 `json:"BK1_cf"`
BK1EventID string `json:"BK1_event_id"`
BK1EventNativeID string `json:"BK1_event_native_id"`
BK1Game string `json:"BK1_game"`
BK1Href string `json:"BK1_href"`
BK1League string `json:"BK1_league"`
BK1Name string `json:"BK1_name"`
BK1Score string `json:"BK1_score"`
BK1EventMeta string `json:"BK1_event_meta"`
BK1MarketMeta string `json:"BK1_market_meta"`
BK2Bet string `json:"BK2_bet"`
BK2BetType string `json:"BK2_bet_type"`
BK2AltBet string `json:"BK2_alt_bet"`
BK2Cf float64 `json:"BK2_cf"`
BK2EventID string `json:"BK2_event_id"`
BK2EventNativeID string `json:"BK2_event_native_id"`
BK2Game string `json:"BK2_game"`
BK2Href string `json:"BK2_href"`
BK2League string `json:"BK2_league"`
BK2Name string `json:"BK2_name"`
BK2Score string `json:"BK2_score"`
BK2EventMeta string `json:"BK2_event_meta"`
BK2MarketMeta string `json:"BK2_market_meta"`
AliveSec int `json:"alive_sec"`
ValuingData ValuingData `json:"valuing_data"`
}
type ValuingData struct {
Data Data `json:"data"`
}
type Data struct {
NeedCfs []float64 `json:"need_cfs"`
CfOrig float64 `json:"cf_orig"`
AwAvg int `json:"aw_avg"`
AwMdn float64 `json:"aw_mdn"`
OwAvg float64 `json:"ow_avg"`
OwMdn float64 `json:"ow_mdn"`
Ow2Avg int `json:"ow2_avg"`
Ow2Mdn int `json:"ow2_mdn"`
CfMdn float64 `json:"cf_mdn"`
CfAvg float64 `json:"cf_avg"`
CfAvg2 float64 `json:"cf_avg2"`
CfMdn2 float64 `json:"cf_mdn2"`
DiffAvg float64 `json:"diff_avg"`
DiffMdn float64 `json:"diff_mdn"`
MinMaxDst float64 `json:"min_max_dst"`
TotalCnt int `json:"total_cnt"`
TotalPos int `json:"total_pos"`
BetterCnt int `json:"better_cnt"`
MinAw float64 `json:"min_aw"`
MinOw float64 `json:"min_ow"`
MinDiff float64 `json:"min_diff"`
}