calatonsystems / wc-api-java

Java wrapper for WooCommerce REST API
MIT License
98 stars 77 forks source link

http request failed using Oauth 1.0 #8

Open guilherme-oliveria opened 6 years ago

guilherme-oliveria commented 6 years ago

I'm having difficulty getting into my products, because the url error http 401, oh consumer_key is correct and the secret is also the only way I can get the data and passing the "cafearabesco.com/wp-json/wc/v2/products?consume_key=ajsajs77kajsak....&consume_secret=njnjnjnjn2n3j23nj2.." but this way it is not safe and on the server in production of the ssl error.

http://uploaddeimagens.com.br/imagens/postman_12-png

http://uploaddeimagens.com.br/imagens/postman-jpg

guilherme-oliveria commented 6 years ago

copy and paste the link in the browser

omandryk commented 6 years ago

Hi @guilherme-oliveria if you have SSL on your server you may use Basic Authentication: http://woocommerce.github.io/woocommerce-rest-api-docs/#authentication-over-https

guilherme-oliveria commented 6 years ago

add params "query_string_auth" = true

guilherme-oliveria commented 6 years ago

in classe enum OauthHeader

guilherme-oliveria commented 6 years ago

I have not been successful since yesterday. my localhost application works but on the server in production because my site in wp and https, and the class DefaulthttpClient uses, HttpResponse httpResponse = httpClient.execute(httpRequest);
and my server from ssl error. " Caused by: javax.net.ssl.SSLPeerUnverifiedException: Host name 'antioquia.com' does not match the certificate subject provided by the peer"