.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Client using OpenSSL is not able to connect to Server using SslStream.

Posted By:      Posted Date: September 20, 2010    Points: 0   Category :.NET Framework

I have been trying to get a client written in C++ using OpenSSL 0.9.8a to connect successfully with a server written in C# using the SslStream class in .NET 4.0.  Thus far, I have been not able to get the client to successfully connect and communicate even when my server does not require a client certificate from the client.

I am getting always the following IOException " The handshake failed due to an unexpected packet format. " when i am reaching the AuthenticateAsServe() line in my server.

Any help will be highly appreciated.

View Complete Post

More Related Resource Links

Unable to connect to SQL Server 2005 remotly, all client protocols are blank

I have an installation of SQL 2005 and had issues connecting remotly. Looking at the client protocolols, they are all blank. I can see that TCPIP, Named Pipes, VIA, etc. are 'enabled', but where the words 'TCPIP', 'Names Pipes', etc. should be, it's just blank. I tried to install SQL 2008R hoping the Client Protocols would be corrected during the installaion, but they were not. I'm assuming the issue with the Client Protocols not showing up is a symptom of the problem. Does anyone have any ideas? Thanks!

How can a C# client app list the authorized CA certificates sent by a web server over an SSL connect

Hello, I am currently writting a C# client application that must access a web page over SSL authentication, having the Client authentication required. I know that the SSL protocol defines that the web server sends the list of authorized Certification Authority that the web server can trust for the SLL session to be successful. My client application has to filter a X509Certificate collection in order to popup a Certificate Selection dialog box to the user. I fould like to only display certificates that the web server would accept. I already have filtered the certificates according to the "Client Authentication" Enhanced Key Usage and other stuf. I know how to set the client certificate to be used for SLL conection, but I just would like to access the CA cert list provided by the server.   Could someone help me ? Thanks a lot !

Client/Server Authentication with SSLStream

Hello, This is my first time using MSDN.  I have a client and server application which use SSLStream to communicate over port 80.  Both the client and the server are running as Windows Services.  Everything works in my test environment (my development computer, under the OS Windows 7 Ultimate). My problem is that when I go to deploy the client and server application to their deployment environments (the server being on Windows Server 2008, and the client being on Windows Server 2003) it does not work, and I get the error: "The client and server cannot communicate, because they do not possess a common algorithm" Please note that I have installed the same certificate using the makecert commands (listed in the "Firstly" section below) In addition, when I gave up on trying to get the client to authenticate under the Windows Server 2003 computer, I moved it to a completely new/different Windows Server 2008 computer.. and then got a new error along the lines of "credentials supplied to package not recognized." If you have any experience with this issue, please advise.  I have been working on this for the past 3 days and have burnt up over 20 hours of development time. Please remember, the problem keeps happening when the Server and Client attempt to authenticate. Firstly, I used the following commands via makece

How to connect to MOSS server using visual studio from client side

Dear All We are having one moss development environment and we are having many developers working on it.Since all the developers cannot work at a time,we are facing difficulties while developing sharepoint components. Is there any way to connect to sharepoint server from visual studio(from client side) so that we can compile our sharepoint components from client side and deploy later to the server? Any help on this would be much appreciated? Thanks Karthik S

how to connect my RTC client to server, if i'm firewalled?


hello everybody,

so i try to explain in short what is the problem.

My OS is WinXP SP2, and my computer ir firewalled from outside, i'm running Microsoft Firewall Client for ISA server.

My RTC client connects to the server over SIP protocol, registering, and after it is registered i can make calls such like PC-to-PHONE. The source of my RTC client you can find there: http://ausroma.projektas.lt/temp/Source.txt

it works fine when i connect to PBX sip server which is in our internal network, but i can't connect when i try to connect to the server which is outside firewall....

i have another SIP client (X-Lite): http://ausroma.projektas.lt/temp/x-lite.JPG and it works fine (register succesfully) when ISA firewall is enabled on my PC (when i disable ISA this client can't connect and i have registering time-out). I sniffed some packets, when ISA is enabled, and x-lite client connects succesfully: http://ausroma.projektas.lt/temp/xlite_sniff.JPG how we can see, there is sending requests, and we recieve respons

Net.TCP Endpoint; Windows Authentication security; client can connect to a server at localhost but n


Hey all, so here's what going on:

I have a WCF Service that I have setup as a Windows Service.  Everything works perfectly when I attempt to use the system with all of the components (i.e. server and clients) on the same machine.  However, when I try to connect my client from a different system, I get an error that is trying to tell me that the server rejected the client's credentials.

I need the client to the able to connect from a different machine.  I want to implement a SQL Role Provider kind of credentialing in the future, but for now, I just need it to work.

What I have tried
I have looked around online and read a few other posts as well some things in the MSDN KB and I have either not found the answer, or not understood it.

  • I have tried setting the <security mode="Transport"> to "None" with the hope that that would disable the accreditation entirely.  All it did was result in a different error saying that there was an error that might have been caused by an invalid message.  I have also tried a few other configurations with this element in the app.config file; to no success.
  • I have read some things about Impersonation, but I am not quite sure I understand how to implement it

Custom client app cannot connect to SQL server 2008



We have a custom application developed using Access 2003 but converted to 2007 which connects to database SQL server 2008 converted from 2005. Users are unable to connect via application and get the following error.  Application uses ADO.NET to connect. But when Network library configuration and enable TCP/IP protocol with servername and portno using SQL Server Network Utility setup (cliconfg), It works fine. We have about 150 users but it is complicated to do for each users.

Also users uses windows authentication to connect. They belong to one of the three Windows Active Directory groups which are given RW permission on the database side.

'Connection Failed' error.

SQL State 01000

ODBC SQL Server Driver: ConnectionOpen(Connect())

Connection failed.

SQL State: '08001'

SQL Server Error: 17

[ODBC SQL Server Driver] [DBNETLIB] SQL Server does not exist or access denied.



connectionstring : "ODBC;DRIVER=SQL Server;SERVER=<<server>>;DATABASE=<<database>>;Trusted_Connection=Yes"



Please help.



Client can't connect to WCF on deployment machine Windows 2003 Sp2 server .NET 3.5



I have a WCF service hosted in a Windows service application.  I have a Windows Form client that connects to it.  I am using net.tcp binding for two endpoints.   It all works fine in my environment, but when I deploy it on my cutomer's machine the client does not get a response from the service.

I ran netstat -na and I can see the endpoints listening.  I can even see the connection ESTABLISHED when my client runs the first method.  But my client times out and receives a "Could not communicate with XXX service.  This request operation sent to net.tcp..... did not receive a reply within the configured timeout (00.01.00) The time alloted... etc"

I tried removing all security from the configuration file, but that did not make a difference.

I reinstalled .NET Framework 3.5

I added     System.Net.ServicePointManager.DefaultConnectionLimit = 200 as suggested in another post.

I am creating a trace for the client and the server.  The server does not log any activity of a connection.  The client is catching a communication exception.

Any insight would be greatly appreciated.  What else can I try to see why the client is not able to chake hands with the server on this particular machine?

Many thanks,



ClickOnce: Deploy and Update Your Smart Client Projects Using a Central Server


ClickOnce is a new deployment technology that allows users to download and execute Windows-based client applications over the Web, a network share, or from a local disk. Users get the rich interactive and stateful experience of Windows Forms, but still have the ease of deployment and updates available to Web applications. ClickOnce applications can be run offline and support a variety of automatic and manual update scenarios.Learn all about it here.

Brian Noyes

MSDN Magazine May 2004

SOAP: Using ATL Server to Build an Asynchronous SOAP Client in Unmanaged C++


SOAP opens up a new world of Web Services, letting you make function calls across a network or the Internet. But this flexibility creates new problems when your app needs to wait for calls to return from halfway around the world. What you need is an asynchronous SOAP client that takes advantage of threading to continue execution while waiting for calls over the wire. This article covers the basics of building such a client with ATL.

Pranish Kumar and Bogdan Crivat

MSDN Magazine April 2002

need help about "Unable to connect to remote server." using HttpWebRequest


Hello friends 
I am creating an application where I want to store an html page from one of my websites into another web site. 
For the same purpose I am taking the url of the html pages 
for example if I want to copy this page "http://mydomain.com/html/page1.html" then i take this url from a text box which user enters.

passing object values from server to client problem


I get a message that x_login is not declared.  I added Dim login as String = "123", but that didn't help.  What's the problem?

code behind....

Dim Login = "123"
x_login.Value = loginID


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<form id="simForm" runat="server" method='post' action='https://test.authorize.net/gateway/transact.dll'>
        <input id="HiddenValue" type="hidden" value="Initial Value" runat="server" />
        <input type='hidden' runat="server" name='x_login' id='x_login' />
        <input type='submit' runat="server" id='buttonLabel' />



How to connect to local instance of SQL Server 2008 Management Studio Express ?


I just installed SQL Server 2008 Management studio Express on my Vista machine.

i tried connecting to local machine using :

.\sqlexpress, (local)\sqlexpress, or .\SQLExpress, MyPCNAME\SQLExpress

nothing is working, getting this error:

Cannot connect to PC-NAME\SQLEXPRESS. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Using SQL Server 2008 R2 client with Enterprise Library



I am modifying an existing application that uses SQL Server 2008 as the database and Enterprise Library 4.1 for Data Access .

What I need to do is to make it use the SQL Server 2008 R2 client to take advantage of out of the box failover capabilities.

Any idea how I can accomplish this?


Educational question: How server objects are accessed from multiple client threads?

I will appreciate it if someone can help me to undestand how the following scenario works:   There is remoting server that is registered as WellKnownObjectMode.Singleton. Server implementation: It instantiates a class TestServer that implements interface IFoo interface IFoo { IHelper GetHelper() }   interface IHelper { void StoreString(); }   Implementation of TestServer: internal sealed class TestServer: System.MarshalByRefObject, IFoo { private IHelper> helper = new Helper(); public IHelper GetHelper(string helper){return helper;} }   Implementation of Helper: internal sealed class Helper : System.MarshalByRefObject, IHelper { public void StoreString (string val) {}; }   Implementation of a client (simplified; shown to illustrate the question only): static class Program { public static IFoo TestService; public static IHelper Helper; public TestThreads testmultiplecalls; [STAThread] static void Main() { TestService = (IFoo)Activator.GetObject(typeof(IFoo),"ipc://Channel"); Helper = TestService.GetHelper(); testmultiplecalls.Start(); } }   internal class TestThreads { public Start() { for (int i = 0; i < 20; i++) ThreadPool.QueueUserWorkItem((new TestCall(i.ToString())).DoWork); } }     internal class TestCall { private string m_str; public TestCall (string str) {m_str = str;} public void DoWork() { Program.Helper.StoreString(m_str); } }     Que

sslstream client certificate validation error

Hi,I have taken server and client program from MSDN2 for sslstream. in that code client certifiacte authetication is made false  i want to enable that and do the code i have done some modification to the code but is giving error "RemoteCertificateNotAvailable" and i think that its not getting the client certificate at server side.So please can any one help me to do client server program using sslstream in which client certificate also needs to be validated.I am attaching my modified code of MSDN2Server sideusing System;using System.Collections;using System.Net;using System.Net.Sockets;using System.Net.Security;using System.Security.Authentication;using System.Text;using System.Security.Cryptography.X509Certificates;using System.IO;namespace Examples.System.Net{    public sealed class SslTcpServer     {        static X509Certificate serverCertificate = null;        // The certificate parameter specifies the name of the file         // containing the machine certificate.        // The following method is invoked by the RemoteCertificateValidationDelegate.        public static bool ValidateClientCertificate(              object sender,              X509Certificate certificate,              X509Chain chain,              SslPolicyErrors sslPolicyErrors)        {            SslPolicyErrors errors = sslPolicyErrors;            if (errors != SslPolicyErrors.None)            {

sqlcmd, cannot connect to server

I have SQL Server installed on a machine called SQLDEV. I log on to that machine and I run the command sqlcmd -s SQLDEV -Q "select * from <db>.<schema>.<some_table> -E This command works and returns a result set.   Next, I go to a different machine. On that machine I can use SQL Mgmt Studio to log on to SQLDEV using window authentication. However, if I run the same command as above, I get some kind of a connection error. The error says, ".... When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections .....   Any suggestions/ideas why I am getting this error?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend