}
The RemoteCertificateValidationCallback part is used to programatically avoid the following warning which would popup due to self signed cert usage.
10. Now run the program.
You can see that for the right credentials, service will run just fine. Otherwise a security exception will be thrown.
Source code can be downloaded from here.
Feel free to drop me an email or comment here if you have any questions.
References and Further Readings: