Comments (6)
I downloaded the Mashape client library source and imported the custom renamed package of Apache Commons Codec. Therefore the issue with Base64 has been resolved. However I have not been able to get Apache http working. The issue I am having is in com.mashape.client.http.HTTPClient.java. In the method:
private static void configureSSLHttpClient(org.apache.http.client.HttpClient client) {
// Accept any SSL certificate
SSLContext sslContext;
try {
sslContext = SSLContext.getInstance("SSL");
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
try {
sslContext.init(null, new TrustManager[] { SSLVerifierFactory.getCustomSSLVerifier() }, new SecureRandom());
} catch (KeyManagementException e) {
throw new RuntimeException(e);
}
SSLSocketFactory socketFactory = new SSLSocketFactory(sslContext, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
Scheme https = new Scheme("https", 443, socketFactory);
client.getConnectionManager().getSchemeRegistry().register(https);
}
Creating a socket factory isn't possible with the arguments and downloading httpd from Apache is just c source files. How did you import a custom renamed package of Apache to import as your java library? Or alternatively how do you create the socet factory here. Android has an implementation of SSLSocketFactory but it takes a keystore. This is a major roadblock to me using mashape :(.
from unirest-java.
Trying to work around this, can you explain how to "import custom renamed package"?
from unirest-java.
This should have been fixed (v2.0.3). Can you please try to get the latest release of the Java client?
If you're using Maven:
<repository>
<id>mashape-releases</id>
<url>https://github.com/Mashape/MVNRepo/raw/master/releases</url>
</repository>
<dependency>
<groupId>com.mashape.clients</groupId>
<artifactId>mashape-java-client</artifactId>
<version>2.0.3</version>
</dependency>
from unirest-java.
I didn't realize there was a new version. It's working now, thanks.
On Oct 7, 2012 7:34 PM, "Marco Palladino" [email protected] wrote:
This should have been fixed (v2.0.3). Can you please try to get the latest
release of the Java client?If you're using Maven:
mashape-releases https://github.com/Mashape/MVNRepo/raw/master/releases com.mashape.clients mashape-java-client 2.0.3—
Reply to this email directly or view it on GitHubhttps://github.com/Mashape/mashape-java-client-library/issues/1#issuecomment-9214224.
from unirest-java.
Great, closing it.
from unirest-java.
I think I've answered this question? Anyway, after these changes exceptions disappeared.
return Base64.encodeBase64String(msgData.getEncoded());
to
return new String(Base64.encodeBase64(msgData.getEncoded(), false), "UTF-8");
Client.java, line 616:
Hex.encodeHexString(hash)
to
new String(Hex.encodeHex(hash)));
from unirest-java.
Related Issues (20)
- 4.0.4 isn't on the maven repository. HOT 1
- UnirestInstance.request() Method behaves differently than expected. HOT 3
- Configure custom retry behavior HOT 12
- Describe configuring concurrency in v4 HOT 1
- MockResponse does not work with Unirest 4 anymore HOT 7
- connectionTTL configuration ignored HOT 5
- Low level interceptor with shared context HOT 10
- bug query get with version 4 HOT 5
- Jackson MismatchedInputException for successful response with no body, after migrating to Unirest 4 HOT 2
- Automatic Retries not being used HOT 2
- MockClient: allow fine grained request verification or "un-expected" routes HOT 2
- Request cancellation (such as download cancellation) HOT 2
- Can't turn auto retries standard on HOT 10
- Incorrect Unirest version in README.md HOT 1
- Incorrect link to Interceptor file HOT 1
- Supported windows versions
- Configured HttpClient.Version ignored HOT 10
- MockClient: Mocking same route with different methods only invokes first registered/expected mocking response HOT 2
- multipart/form-data POST is missing content types HOT 6
- How to set read timeout duration HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unirest-java.