Git Product home page Git Product logo

Comments (6)

m3hughes avatar m3hughes commented on July 28, 2024

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.

jjohns63 avatar jjohns63 commented on July 28, 2024

Trying to work around this, can you explain how to "import custom renamed package"?

from unirest-java.

subnetmarco avatar subnetmarco commented on July 28, 2024

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.

jjohns63 avatar jjohns63 commented on July 28, 2024

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.

subnetmarco avatar subnetmarco commented on July 28, 2024

Great, closing it.

from unirest-java.

vaishupatel avatar vaishupatel commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.