Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User mtaponen's Avatar
    Join Date
    Nov 2006
    Posts
    4
    Hi

    I was making a TLS connection with S60 3 FP1 - sdk and stumbled onto this:

    I keep getting KErrSSLAlertUnexpectedMessage both in emulator & HW.

    So the socket connects nicely over Winsock in emulator. Then the StartClienthandshake always comes up with status -7510.
    There were some posting on other error codes ans older platform versions but if someone has actually asked this please point me to the answer

    Just in case I missed/messed something bad - here is stripped down example code which I can be triggered by constucting the object from UI your facourite event - port & address is hardcoded:



    Code:
    CSecureConnector::CSecureConnector() :   CActive(CActive::EPriorityStandard)
    {
    }
    
    CSecureConnector::~CSecureConnector()
    {
    }
    
    CSecureConnector* CSecureConnector::CSecureConnector::NewL()
    {
    	CSecureConnector* self = new (ELeave) CSecureConnector();
    	CleanupStack::PushL(self);
    	self->ConstructL();	
    	CleanupStack::Pop();
    	return self;
    }
    
    void CSecureConnector::ConstructL()
    {
    
    	CActiveScheduler::Add(this);
    
                CAknInformationNote* note = new ( ELeave ) CAknInformationNote;
    
              
    	        
    		    TNameEntry nameEntry;
    			TInt err;
    	
    
    	    iPrefs.SetDialogPreference( ECommDbDialogPrefPrompt );    
    
    		err = iSession.Connect();        
    		RDebug::Print(_L("iSession.Connect %d"), err);
    	    RHostResolver resolver;
    		
    		if (err == KErrNone)
    			{
    	   
    		    iConnection.Open( iSession );
    		    iConnection.Start(iPrefs);       
    		    //
    			err = resolver.Open( iSession, KAfInet, KProtocolInetUdp, iConnection ) ;    
    			iErrorText.Format(_L("resolver.Open %d"), err);
    			RDebug::Print(iErrorText);
    			}
    		
    		if (err == KErrNone)
    			{
    	   	    err = resolver.GetByName( _L("myhost.here"), nameEntry );
    			iErrorText.Format(_L("resolver.GetByName %d"), err);	
    	   		RDebug::Print(iErrorText);
    			}
    
    		if (err == KErrNone)
    			{
    	    	TInt32 aAddr = TInetAddr::Cast( nameEntry().iAddr ).Address();
    		    iAddress.SetPort( 447 ); // Put your favourite SSL port here
    		    iAddress.SetAddress( aAddr );
    		    RDebug::Print(_L("CXmppConnection::ResolveHostL  aAddr = 0x%x"), aAddr);
    		    resolver.Close();    
    		    err = iSocket.Open( iSession, KAfInet, KSockStream, KProtocolInetTcp, iConnection );
    	    	iErrorText.Format(_L("iSocket.Open %d"), err);
    	    	RDebug::Print(iErrorText);
    	    	}
    
    		if (err == KErrNone)
    			{
       
    		    RDebug::Print(_L("iSocket.Connect"));
    		    iSocket.Connect( iAddress, iStatus );
    		    RDebug::Print(_L("iSocket.Connect ok"));
    		    User::WaitForRequest(iStatus);	// I know this is not good practice here I liked to simplify this down. 
                                                                       //So please make active object with states as I'm doing with my real implementation
    			iErrorText.Format(_L("iSocket.Connect status %d "), iStatus);
    			RDebug::Print(iErrorText);
    	    	
    			}
    			if (iStatus == KErrNone)
    					{
    					iSecureSocket = CSecureSocket::NewL(iSocket, _L("TLS1.0") );
    			 		RDebug::Print(_L("CSecureSocket::NewL ('TLS1.0') ok"));
    			      	iSecureSocket->SetOpt(KSoSSLDomainName,KSolInetSSL, _L8(""));
    			    	iSecureSocket->SetDialogMode(EDialogModeAttended);
    			    	RDebug::Print(_L("SecureSocket->SetOpt ok"));
    			    	iSecureSocket->StartClientHandshake(iStatus);
    			    	SetActive();
    					}
    		note->ExecuteLD( iErrorText);
    			
    }
    
    void CSecureConnector::RunL()
    {
        CAknInformationNote* note = new ( ELeave ) CAknInformationNote;
    		
    	iErrorText.Format(_L("iSecureSocket->StartClientHandshake %d"), iStatus);
    	RDebug::Print(iErrorText);
    		 
     
        note->ExecuteLD( iErrorText);
    	
    	
    }
    
    void CSecureConnector::DoCancel()
    {
    	
    }
    And here is the class definition:
    Code:
    class CSecureConnector : public CActive
    {
    	public:
    		static CSecureConnector* NewL();
    		void RunL();
    		~CSecureConnector();
    		
    		
    	private:
    		void DoCancel();
    		void ConstructL();
    		CSecureConnector();	
    		
    	
    	protected:
    		// data
    		
    		RSocketServ iSession;
    	    RSocket iSocket;
        	CSecureSocket* iSecureSocket;
    	    RConnection iConnection;
    	    TCommDbConnPref iPrefs;
    	    TInetAddr iAddress;
    	    TBuf<50> iErrorText;
    };
    <edit - fixed a small typo in the code>
    Last edited by mtaponen; 2006-11-10 at 06:38.
    This space was intentionally left blank.

  2. #2
    Registered User mtaponen's Avatar
    Join Date
    Nov 2006
    Posts
    4
    Ok - knew this was going to happen.

    2 hrs after the post I discovered (I think) the problem residing on the server side. I changed the authentication settins on the server and this problem was resolved.
    So for all of you there - try with something that you know supports TLS :blushes:

    I leave my question in place in case someone would stumble on the same issue later and would use search
    This space was intentionally left blank.

  3. #3
    Registered User savvy's Avatar
    Join Date
    May 2007
    Posts
    12
    Hi

    I have been facing the same problem. I am trying to connect to a webserver which resides behind a Microsoft ISA server.

    I am making calls to the web server via SOAP web method calls using gSOAP library. I am using Symbian secure sockets to make the secure connections.

    When the soap connect happens, I open the symbian secure socket and finally when StartClientHandshake is executed, it returns an error -7510 which is KErrSSLAlertUnexpectedMessage.

    I found you faced the same peorblem and fixed it by setting things right on the server side. Could u please more specific about the answer.

    Thank you for any help

  4. #4
    Registered User bmy's Avatar
    Join Date
    Mar 2003
    Posts
    2
    I face the the same problem too .and How do you solve this problem?
    After the TLs negotiation with the function of StartClientHandshake,the method of runL() get nothing back then my application is still waiting ?
    can you help me ?

  5. #5
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    27,746
    Unfortunately this can happen. I experience the same with ejabberd (just a guess from 'TLS negotiation').
    Your application is not waiting after that. TLS handshaking failed and you can close the socket.

  6. #6
    Regular Contributor sanjayk84's Avatar
    Join Date
    Apr 2008
    Posts
    87
    Hi all
    i am getting this type of error, to making secure connection

    KErrSSLAlertUnexpectedMessage -7510

    when start StartClientHandshake

    and the same port and Ip are use to other devices (i-phone ,Andorra, blackberry, windows ) are connected successfully.
    i am not getting what the problem with symbain devices..

Similar Threads

  1. Establishing a data call fails
    By prasanna_lakshmi in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2009-06-14, 09:50
  2. CVideoPlayerUtility video streaming fails on 7610?
    By k4l4 in forum Symbian Networking & Messaging (Closed)
    Replies: 10
    Last Post: 2008-11-18, 16:18
  3. HELP: HTTPS connection always fails!
    By xiaomingzhou in forum Symbian Networking & Messaging (Closed)
    Replies: 11
    Last Post: 2008-04-07, 05:14
  4. If Insertion fails
    By Alicia_S60 in forum Symbian C++
    Replies: 0
    Last Post: 2005-04-04, 06:57
  5. Replies: 1
    Last Post: 2002-05-16, 19:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved