Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request via HTTPS scheme not possible #50

Open
simplylu opened this issue Apr 17, 2022 · 0 comments
Open

Request via HTTPS scheme not possible #50

simplylu opened this issue Apr 17, 2022 · 0 comments

Comments

@simplylu
Copy link

Installed dependencies
Processing 3.5.4
HTTP-Requests-for-Processing: 0.1.5
Android Mode: 4.2.1

Code

import http.requests.*;

public void setup() {
  size(400, 400);

  GetRequest get = new GetRequest("https://ipinfo.io/json");
  get.send(); // d program will wait untill the request is completed
  println("response: " + get.getContent());
  JSONObject response = parseJSONObject(get.getContent());
  println("status: " + response.getString("status"));
  println("data: " + response.getJSONObject("data"));
}

and added <uses-permission android:name="android.permission.INTERNET"/> to the related AndroidManifest.xml

Output

...
BUILD SUCCESSFUL in 19s
25 actionable tasks: 25 executed
FATAL EXCEPTION: Animation Thread
Process: processing.test.test, PID: 22245
java.lang.IncompatibleClassChangeError: Class 'org.apache.http.conn.ssl.SSLSocketFactory' does not implement interface 'org.apache.http.conn.scheme.SchemeSocketFactory' in call to 'java.net.Socket org.apache.http.conn.scheme.SchemeSocketFactory.createSocket(org.apache.http.params.HttpParams)' (declaration of 'org.apache.http.impl.conn.DefaultClientConnectionOperator' appears in /data/app/processing.test.test-cwaQQ5qAEO9ZXXlmvpNwWQ==/base.apk)
	at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)
	at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
	at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
	at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:573)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
	at http.requests.GetRequest.send(Unknown Source:61)
	at processing.test.test.test.setup(test.java:43)
	at processing.core.PApplet.handleDraw(PApplet.java:1878)
	at processing.core.PSurfaceNone.callDraw(PSurfaceNone.java:478)
	at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:518)

Expected behaviour
Get data from ipinfo.io and print it

When using HTTP instead of HTTPS, all works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant