Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / September 2007

Tip: Looking for answers? Try searching our database.

Speeding up a web service over SSL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Jackson - 01 Sep 2007 15:17 GMT
Hello,

I'm presently developing a WinForms app in C# (VS.NET 2005) which needs to
interface with a web service running on the company's public Internet site.
The webservice is very simple - it receives a string, looks it up in a SQL
Server database, and returns another string based on the results of the
database query.

Problem now is the amount of time it takes to return a value to the
webservice over SSL.

If I point the WinForms client at the webservice without going over SSL, it
returns in approximately 0.1 seconds e.g.
http://www.xxx.com/webservices/testservice.asmx

However, as soon as I modify the call to the webservice to run over SSL, it
returns in approximately 10.5 seconds  e.g.
https://www.xxx.com/webservices/testservice.asmx

Obviously, I expect a slight loss of performance because of the overhead of
SSL, but wasn't expecting it to be quite as bad as this.

When I point a web browser at
https://www.xxx.com/webservices/testservice.asmx, it shows the page almost
instantly, with the Service Description hyperlink and a bulleted list of the
methods contained in the webservice, so I don't think it's a networking
issue.

Similarly, when I point the WinForms client at other commercial webservices
which run over SSL, they seem to return almost instantly.

I've had a bit of a trawl round Google but haven't found anything which
helped to speed things up. One site suggested adding CacheDuration to the
[WebMethod] declaration but that has not helped.

Can anyone please give me any pointers about some things I could try to
speed this up?

Thanks

DJ
wmain - 01 Sep 2007 16:38 GMT
Have you thought of using something like fiddler to see the packets being
generated? I have a feeling it's a negotionation for authentication that is
causeing the problem. Windows need to validate the ssl certificate.

> Hello,
>
[quoted text clipped - 37 lines]
>
> DJ
David Jackson - 01 Sep 2007 17:24 GMT
Thanks for the reply.

> Have you thought of using something like fiddler to see the packets being
> generated?

I haven't, because HTTP connectivity is fine. It's only when I try to
connect over HTTPS that it's really slow.

DJ
Peter Bromberg [C# MVP] - 01 Sep 2007 18:26 GMT
Well, that was his point- that the SSL handshake is what is taking up all the
time.
You might consider employing some sort of message-level authentication if
you can, and dispense with the SSL. Or, you can encrypt at the message level
and also dispense with the HTTPS protocol.
-- Peter
Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder:    http://www.blogmetafinder.com

> Thanks for the reply.
>
[quoted text clipped - 5 lines]
>
> DJ
David Jackson - 01 Sep 2007 19:57 GMT
> Well, that was his point - that the SSL handshake is what is taking up all
> the
> time.

Yes, but Fiddler wouldn't be able to help me with that because it doesn't
support HTTPS, as far as I can see, or am I incorrect?

> You might consider employing some sort of message-level authentication if
> you can, and dispense with the SSL. Or, you can encrypt at the message
> level
> and also dispense with the HTTPS protocol.

OK, that's an interesting thought I hadn't even considered. Thanks very
much.
Hans Kesting - 03 Sep 2007 13:20 GMT
> Yes, but Fiddler wouldn't be able to help me with that because it
> doesn't support HTTPS, as far as I can see, or am I incorrect?

Fiddler2 does

http://www.fiddler2.com/fiddler2/

Hans Kesting
David Jackson - 03 Sep 2007 13:36 GMT
>> Yes, but Fiddler wouldn't be able to help me with that because it
>> doesn't support HTTPS, as far as I can see, or am I incorrect?
>
> Fiddler2 does
>
> http://www.fiddler2.com/fiddler2/

Thanks for that, and apologies to Peter...

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.