Symbian3/SDK/Source/GUID-F41C1661-9704-500F-9324-B13748642332.dita
changeset 13 48780e181b38
equal deleted inserted replaced
12:80ef3a206772 13:48780e181b38
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE task
       
    11   PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
       
    12 <task id="GUID-F41C1661-9704-500F-9324-B13748642332" xml:lang="en"><title>Configuring
       
    13 the Server Name Indication : Tutorial</title><shortdesc>This topic describes how to configure the server name indication. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
       
    14 <context><p>Servers that support a virtual name-based hosting must know the
       
    15 virtual names of the client that tries to establish a connection. The virtual
       
    16 name-based hosts controls the decision of the server. The decision of server
       
    17 is to return the server certificate or PSK if you use a <xref href="GUID-5927A119-C520-572D-83AF-7265DEEF4553.dita">PSK
       
    18 ciphersuite</xref>. </p> <p>To address this issue, Symbian implements the <i>server
       
    19 name indication</i> extension which is specified in <xref href="http://www.ietf.org/rfc/rfc4366.txt" scope="external">RFC4366</xref>. </p> <p>Note: To maintain maximum compatibility
       
    20 with the existing servers, a server name indication extension is not sent
       
    21 to the server unless the server explicitly requests it. For example the implementer
       
    22 Secure User Plane Location (SUPL) has to use this feature explicitly. </p><p>The
       
    23 steps required to establish a connection are shown below:</p> </context>
       
    24 <steps id="GUID-3E3F3827-9E36-5698-B243-762A6F5CEB05">
       
    25 <step id="GUID-F7137318-D1E9-5B27-BD99-21EB74F17312"><cmd>Create an array
       
    26 class. </cmd>
       
    27 </step>
       
    28 <step id="GUID-B891B8D2-A519-5B86-9922-F089586C5F41"><cmd>Wrap the array class. </cmd>
       
    29 </step>
       
    30 <step id="GUID-8394FCDF-6AA7-5603-9E6E-F7DB8EE5C83D"><cmd>Call <xref href="GUID-C1DE3BCF-CEEB-32AC-A870-EE6A7A80DEE5.dita"><apiname>Setopt()</apiname></xref> on
       
    31 CSecureSocket to pass the array of names.</cmd>
       
    32 </step>
       
    33 </steps>
       
    34 <example><title> Example</title> <p>The following example code shows how to
       
    35 find the server names that the client is attempting to establish a connection: </p> <codeblock id="GUID-BD9A80A0-823A-5360-9AF3-415F47BD882D" xml:space="preserve">
       
    36 
       
    37 //Create an array class
       
    38   CDesC8ArrayFlat *serverNames = new(ELeave) CDesC8ArrayFlat(1);
       
    39   CleanupStack::PushL(serverNames);
       
    40 //Wrap the array class
       
    41   serverNames-&gt;AppendL(serverName);
       
    42 //Call Setopt() on CSecureSocket to pass the array of names in
       
    43   TPckgC&lt;CDesC8Array *&gt; serverNameIndicationPkg(serverNames);
       
    44   User::LeaveIfError(secureSocket-&gt;SetOpt(KSoServerNameIndication, KSolInetSSL, serverNameIndicationPkg));
       
    45 //SecureSocket now owns the serverNames object
       
    46   CleanupStack::Pop(serverNames); 
       
    47 
       
    48 </codeblock> </example>
       
    49 </taskbody></task>