2

We have a number of applications developed in C# that interface with SAP using the SAP .NET Connector 3.0. I'm very familiar with this, and have recently been asked to look at securing this interface by using the SNC (Secure Network Communications) options, which I've also been able to configure and get working.

However, I want to configure my SNC destinations entirely via config file and not programmatically. To specify an unsecure connection, I can specify the following destination in the config file:

<SAP.Middleware.Connector>
    <ClientSettings>
      <DestinationConfiguration>
        <destinations>          
          <add NAME="MySAPName" USER="MyUser" PASSWD="orly" CLIENT="100" LANG="EN" ASHOST="mysapname.mydomain.com" SYSNR="70" MAX_POOL_SIZE="20" IDLE_TIMEOUT="10"/>          
        </destinations>
      </DestinationConfiguration>
    </ClientSettings>
</SAP.Middleware.Connector>

But, to create a secure SNC connection, so far I've only figured out how to do it by configuring the destination programatically, e.g.:

  Params.Add(RfcConfigParameters.AppServerHost, "mysapname.mydomain.com");
  Params.Add(RfcConfigParameters.Name, "MySAPName"); 
  Params.Add(RfcConfigParameters.SystemNumber, "70");                                              
  Params.Add(RfcConfigParameters.Language, "EN");
  Params.Add(RfcConfigParameters.Client, "100");
  Params.Add(RfcConfigParameters.User,"MyUser");
  Params.Add(RfcConfigParameters.Password, "orly");                    

  // Additional Params for SNC, not settable in config?
  Params.Add(RfcConfigParameters.SncMode, "8");                    
  Params.Add(RfcConfigParameters.SncPartnerName, "p:CN=RemovedForConfidentiality, OU=, O=, L=,C=GB");                                                            
  Params.Add(RfcConfigParameters.SncMyName, "p:CN=MyRemovedPartnerName, C=GB, O=, OU=");
  Params.Add(RfcConfigParameters.SncQOP, "8");
  Params.Add(RfcConfigParameters.Trace, "2");

So, given this context my question is: Can I configure an SNC based SAP Destination using only the config file? If so, how?

I realise I could store SncPartnerName etc. in AppSettings but it would be much nicer if it were specifiable in the DestinationConfiguration section. I can't seem to find any documentation on this, however. I should note I'm aware of the the SAP SCN website and have had an unfruitful look on there, although I do not have access to the SAP Service Marketplace.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Gareth
  • 2,746
  • 4
  • 30
  • 44
  • Have you checked the Appendix A of the programming guide? This fives an overview of the parameters, including the SNC params. – vwegert Apr 19 '13 at 08:56
  • Do you have the Url? I can only find the "SAP .Net Connector Programmer's Reference", which doesn't seem to have Appendices. – Gareth Apr 19 '13 at 09:30
  • http://service.sap.com/connectors --> SAP Connector for Microsoft .NET --> Download SAP Connector for Microsoft .NET Version 3.0 --> NCo_30_ProgrammingGuide.pdf – vwegert Apr 19 '13 at 12:34
  • As I stated in the question, I don't have access to the SAP Service Marketplace – Gareth Apr 19 '13 at 12:45
  • Then someone in your company has to have access to the SMP, otherwise you're probably using the connector illegally... – vwegert Apr 19 '13 at 12:47
  • I can assure you we're not using it illegally. Was hoping someone would just know so I can avoid the bureacracy of getting hold of this document! – Gareth Apr 19 '13 at 13:01

1 Answers1

2

A colleague of mine has managed to discover the solution. Sample config file with the parameters required for SNC is as follows:

<SAP.Middleware.Connector>
    <ClientSettings>
      <DestinationConfiguration>
        <destinations>          
          <add NAME="MySAPName" USER="MyUser" PASSWD="orly" CLIENT="100" LANG="EN"
                ASHOST="mysapname.mydomain.com" SYSNR="70" MAX_POOL_SIZE="20" IDLE_TIMEOUT="10"
                SNC_PARTNERNAME="p:CN=mycn.com, OU=A, O=B, L=C, C=GB" 
                SNC_MYNAME="p:CN=myname.com, C=GB, O=A, OU=B" 
                SNC_QOP="8" SNC_MODE="8" TRACE="2"/>          
        </destinations>
      </DestinationConfiguration>
    </ClientSettings>
</SAP.Middleware.Connector>
Gareth
  • 2,746
  • 4
  • 30
  • 44
  • How did you find this out? Specifically, the CN,OU, etc. info in the SNC_PARTNERNAME and SNC_MYNAME fields? What's the difference between SNC_PARTNERNAME and SNC_MYNAME? Is there any info about these fields and what they expect? – Peder Rice Sep 21 '15 at 15:50
  • 1
    You need the SAP NCO 3.0 Programming Guide, which should come as a PDF with the connector. If you have a valid SAP Marketplace account you should be able to log in and download it from the marketplace – Gareth Sep 22 '15 at 07:44