473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Windows Service with SSL not working.

11
Hi

I've created a Tcp Server that uses the SslStream for communication. It works fine when I run the application as a console application but stalls when I call AthenticateAsServer() on the SslStream:

Heres my code:

TcpClient client;

SslStream networkStream = new SslStream(client.GetStream(), false);

X509Certificate serverCertificate = new X509Certificate(@"C:\program files\Test.pfx", "password");

networkStream.AuthenticateAsServer(serverCertifica te, true, SslProtocols.Tls, true); //Just Hangs Here


Does anybody have any ideas as to why this would happen when it runs as a windows service? The service has LocalSystem privileges.

Cheers

F
Apr 15 '09 #1
3 2811
PRR
750 Expert 512MB
What exactly happens when it executes as windows service? do you log error?
Apr 15 '09 #2
frogga
11
The service will continue to run as normal and keeps accepting client connections. Its the processes running the server/client connection that just hang when the server calls AuthenticateAsServer.

I've got the service to write to the event log before and after this call. The "before" is written to the event log but not the "after". No error logs or anything else is written to the event log so each process is just sitting there. Could it be a permissions problem with the certificate store? The certificates are on the local machine but with the service not attached to an account maybe it can't get to the store. This is my first time dealing with windows services and ssl so its all a bit new for me.

Cheers

F
Apr 15 '09 #3
PRR
750 Expert 512MB
Permission problem may be there... could you post some sample code ? and maybe flow of your code ?
Apr 15 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: | last post by:
Hi, I have a Windows Service that uses a referenced dotnet-dll. In my dll I set some public string to a stringvalue that I get from reading a xml-file(my config file). It works fine if I use it...
5
by: | last post by:
Hi, I have a Windows Service that uses a referenced dotnet-dll. In my dll I set some public string to a stringvalue that I get from reading a xml-file(my config file). It works fine if I use it...
1
by: Mahesh Devjibhai Dhola | last post by:
Hi, Scenario: The webservice was developed on windows 2000 Pro and deployed previously on windows XP pro for testing. We have tested for many days. The client for that service was 30+ and...
1
by: Mahesh Devjibhai Dhola | last post by:
Hi, Scenario: The webservice was developed on windows 2000 Pro and deployed previously on windows XP pro for testing. We have tested for many days. The client for that service was 30+ and...
1
by: =?Utf-8?B?TWFuanJlZSBHYXJn?= | last post by:
Hi, I created a web service that I want to host in windows service. The problem is that if I host it as windows service it does not use the configuration file. I have to define the binding,...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.