Results 1 to 10 of 12

Thread: Performance problems with HTTPS

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Location
    San Diego
    Posts
    780

    Default Performance problems with HTTPS

    Has anyone used the Spring Android Rest Template over https?

    We've recently integrated this into our android application and are running into performance problems when we switch our REST urls to HTTPS.

    Everything works fine under HTTP. Response times from the server are around a second to invoke the REST template and deserialize our JSON object. However, when we switch over to HTTPS it's taking 10-20 seconds to get complete the request.

    Anyone else have this problem?

    Thanks,

    Charles

  2. #2

    Default Re: Performance problems with HTTPS

    How are you connecting? Are you using RestTemplate.exchange with an HTTPS URI or some other mechanism?

  3. #3
    Join Date
    Jan 2008
    Location
    San Diego
    Posts
    780

    Default

    Slow:

    Code:
    template.getForObject("https://myserver/foo", Foo.class);
    Fast:

    Code:
    template.getForObject("http://myserver/foo", Foo.class);
    The difference is an order of magnitude (e.g. 500ms cf 5000-10000ms).
    Last edited by chudak; Mar 18th, 2011 at 12:39 PM. Reason: fix method names

  4. #4

    Default Re: Performance problems with HTTPS

    Hmmmmm ....

    I seem to be getting a:

    Code:
    org.springframework.web.client.ResourceAccessException: I/O error: No peer certificate; nested exception is javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
    when I try something similar, however, I am using the exchange method because I want access to the HTTP headers rather than your getForObject:

    Code:
    ResponseEntity responseEntity = restTemplate.exchange("https://myserver/foo", 
    				    	                                     HttpMethod.GET, 
    					                                     new HttpEntity<String(headers), 
    					                                     null);

  5. #5
    Join Date
    Jan 2008
    Location
    San Diego
    Posts
    780

    Default

    The above url was just an example...that's not my actual server url.

  6. #6

    Default Re: Performance problems with HTTPS

    Yes, I know. I was actually using an internal Tomcat server to connect to. Like you, I was using "https://myserver/foo" as a stand-in for the real URL.

  7. #7

    Default секреты игры &

    Интересно написано

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •