knowm / XChange

XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
http://knowm.org/open-source/xchange/
MIT License
3.85k stars 1.94k forks source link

Unable to retrieve data via okex v2 api (moved from www.okex.com to www.okx.com) #4595

Open m1dnightc0der opened 1 year ago

m1dnightc0der commented 1 year ago
2022-10-11 20:41:24.313 [main] DEBUG si.mazi.rescu.Config - Loaded properties from rescu.properties.
2022-10-11 20:41:24.314 [main] DEBUG si.mazi.rescu.Config - Configuration from rescu.properties:
2022-10-11 20:41:24.314 [main] DEBUG si.mazi.rescu.Config - httpConnTimeout = 30000
2022-10-11 20:41:24.314 [main] DEBUG si.mazi.rescu.Config - httpReadTimeout = 30000
2022-10-11 20:41:24.314 [main] DEBUG si.mazi.rescu.Config - proxyHost = null
2022-10-11 20:41:24.314 [main] DEBUG si.mazi.rescu.Config - proxyPort = null
2022-10-11 20:41:24.314 [main] DEBUG si.mazi.rescu.Config - proxyType = null
2022-10-11 20:41:24.314 [main] DEBUG si.mazi.rescu.Config - ignoreHttpErrorCodes = false
2022-10-11 20:41:24.324 [main] INFO  o.knowm.xchange.okex.v5.OkexExchange - Calling Remote Init...
2022-10-11 20:41:24.329 [main] DEBUG si.mazi.rescu.HttpTemplate - Executing GET request at https://www.okex.com/api/v5/public/instruments?instType=SPOT
2022-10-11 20:41:24.329 [main] TRACE si.mazi.rescu.HttpTemplate - Request headers = {Accept=application/json}
2022-10-11 20:41:24.348 [main] TRACE si.mazi.rescu.HttpTemplate - Header request property: key='Accept-Charset', value='UTF-8'
2022-10-11 20:41:24.348 [main] TRACE si.mazi.rescu.HttpTemplate - Header request property: key='User-Agent', value='ResCU JDK/6 AppleWebKit/535.7 Chrome/16.0.912.36 Safari/535.7'
2022-10-11 20:41:24.348 [main] TRACE si.mazi.rescu.HttpTemplate - Header request property: key='Accept', value='application/json'
2022-10-11 20:41:24.876 [main] DEBUG si.mazi.rescu.HttpTemplate - Request http status = 308
2022-10-11 20:41:24.879 [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Transfer-Encoding', value='[chunked]'
2022-10-11 20:41:24.880 [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='CF-Cache-Status', value='[DYNAMIC]'
2022-10-11 20:41:24.880 [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Strict-Transport-Security', value='[max-age=63072000; includeSubdomains; preload]'
2022-10-11 20:41:24.881 [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='CF-RAY', value='[758a12b4fc129c07-FRA]'
2022-10-11 20:41:24.883 [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Server', value='[cloudflare]'
2022-10-11 20:41:24.883 [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Connection', value='[keep-alive]'
2022-10-11 20:41:24.883 [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Set-Cookie', value='[__cf_bm=UBqpCZu3gWPWXClIsPn1K8w8q7Xa9LSxu5pKt_f5t9w-1665517284-0-Ac+YHR9Q1ddRHaYekVqppawF6MbNWNpijBq/WjJ2O/RIYXSzkbCOuw7ay4jN/vBbtXLJw+E9fdMASsMm7sS8ReE=; path=/; expires=Tue, 11-Oct-22 20:11:24 GMT; domain=.okex.com; HttpOnly; Secure; SameSite=None]'
2022-10-11 20:41:24.883 [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Date', value='[Tue, 11 Oct 2022 19:41:24 GMT]'
2022-10-11 20:41:24.883 [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Location', value='[https://www.okx.com/api/v5/public/instruments?instType=SPOT]'
2022-10-11 20:41:24.883 [main] TRACE si.mazi.rescu.HttpTemplate - Header response property: key='Content-Type', value='[text/html; charset=UTF-8]'
2022-10-11 20:41:24.886 [main] DEBUG si.mazi.rescu.HttpTemplate - Http call returned 308; response body:
null
2022-10-11 20:41:24.890 [main] ERROR org.cryptocoinpartners.xchangeUtil - XchangeUtil: Unable to initialze exchange okcoin due to error
org.knowm.xchange.exceptions.ExchangeException: si.mazi.rescu.HttpStatusIOException: HTTP status code was not OK: 308
hanc1208 commented 1 year ago

Add sslUri = "https://www.okx.com" when you initialize exchange specification.