cancel
Showing results for 
Search instead for 
Did you mean: 

Encrypt password to connect Sybase from Perl script

Former Member
0 Kudos

I'm using the "check_sybase" script from Nagios repository to monitorize a Sybase DB.

The problem comes when that Sybase requires to encrypt the password on the network.

I'm using DBD::Sybase as driver to connect with DBI to Sybase. I've checked the documentation of this module and specifies that "encryptPassword=1" on the connection string would be enough. But it does not work. Here my connection string:


$dbh = DBI->connect("dbi:Sybase:encryptPassword=1;server=$dbsvr;database=$dbname;".

                "charset=$charset;timeout=$timeout;".

        "loginTimeout=$timeout", $user, $pass)

  or &ncrit("Could not connect to '$dbname' on '$dbsvr'");

And the error message: Adaptive Server requires encryption of the login password on the network.


  DBI connect('encryptPassword=1;server=XX;database=XX;charset=iso_1;timeout=15;loginTimeout=15','XX',...) failed:

Server message number=1640 severity=16 state=2 line=0 server=XX text=

Adaptive Server requires encryption of the login password on the network.

Server message number=4002 severity=14 state=1 line=0 server=XX text=Login failed.

OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (34)Server XX, database Message String:

Adaptive Server connection failed

No idea on how to solve this.

Moreover, when I connect via isql with the command "-X" works fine.

Pd: I can only connect to those DB which don't require password encryption. I know that this attribute can be modified.

Accepted Solutions (1)

Accepted Solutions (1)

dawn_kim
Contributor
0 Kudos

Hi,

The issue you have can depend on the following.
Does your version of perl support password encryption?
Dos your version of the DBI: Sybase module support password encryption?
When you build DBI:Sybase module what version of the Sybase ocs did you build it with, I know there was some issue with ocs password encryption in SDK 15.0 ESD #19 -ESD22. So if you build the DBI module with this old version of the Sybase ctlib you might have issues.

Thanks,
Dawn Kim

Former Member
0 Kudos

Checked all the version requirements and my perl version is lower than the minimum one. The rest of the components satisfy the minimun requirements.

Version Requirements

For information about platform support, see the Software Developers Kit and Open Server Installation Guidefor your platform.

  • Adaptive Server Enterprise – version 15.7 or later. YES
  • Open Client and Open Server – version 15.7 or later. YES
  • Perl – version 5.14.0 or 5.14.1. NO mine is 5.10.1
  • DBD::SybaseASE driver – no specific version requirements. ¿¿¿???? I use DBD::Sybase
  • CT-Library – (CT-Lib API) version 15.7. YES
  • Perl DBI – version 1.616. YES 1.636

One more thing is that SAP talks about the DBD::SybaseASE driver for the connection and the one I'm using is DBD::Sybase. I don't find the way to install this driver, even the link where I could download from. Not sure if this would have a relevant role in the connection.

dawn_kim
Contributor
0 Kudos

Hi,

We have a perl module installed in the SDK. It depends on the platform you are trying to build this with. In some systems we only have a 64 bit version and this is only available in the 64 bit SDK for SAP ASE. On the systems that use only the 32 bit module you need to get the 32 bit SDK for SAP ASE. It would be in the $Sybase\OCS-15_0\perl directory. There would also be samples in the $Sybase\OCS-15_0\samples\perl directory.

According to DBI:Sybase encryptPassword=1 should work. You might want to post something on CSPAN or the builders of the DBI:Sybase module.

Thanks,
Dawn Kim

Former Member
0 Kudos

Where can I download the SDK from? It's goint to be installed in a CentOS 6.5

0 Kudos

Here are the instructions on how to download SDK:

1. Go to the link http://support.sap.com

2. Click "Login" at the top of the Support Portal page.

3. Select "Software Downloads".

4. In the middle of the Support Portal page, select "Software Downloads".

5. The Launchpad will open in a new screen.

6. At the Launchpad screen, select "SUPPORT PACKAGES & PATCHES".

7. Select "By Alphabetical Index (A-Z)".

8. From the alphabet listing, select "S".

9. From the list of software, click "SDK for SAP ASE".

10. Underneath the DOWNLOADS section, choose the version; for 15.7, select "SYBASE SOFTWARE DEV KIT 15.7". For 16.0, select "SDK FOR SAP ASE 16.0".

11. On the new screen, choose the platform. The platform selection is located in the middle of the Launchpad screen. Choose from the dropdown menu. For example, select "Windows on x64 64bit" for the Windows 64bit install.

12. Select the box with the download item that is desired.

13. Next to the platform dropdown menu, click the shopping cart button to add the download item to Download Basket.

14. Near the bottom of the page, click "Download Basket".

15. In the Download Basket, click the desired SDK EBF link, and the download will begin.

former_member89972
Active Contributor
0 Kudos

Ron

Excellent step by step guide !

You also helped me to get my 32 Bit SDK recently thanks for that too.

AVinash

Answers (1)

Answers (1)

former_member89972
Active Contributor
0 Kudos

There is an article on using ocs.cfg at following link.

It has some debug options check if it helps.

ocs.cfg - SAP Connectivity - SCN Wiki

HTH

Avinash

Former Member
0 Kudos

Already checked that. When I set a new entry for isql and set the CS_SEC_ENCRYPTION to TRUE it works. But when I add a new entry for my aplication (script name) doesn't recognize it.

dawn_kim
Contributor
0 Kudos

Hi,

If you want to use the ocs.cfg buld it like this. You can add CS_SEC_ENCRYPTION to isql also and then from there you would not have to use -X with isql line command.


[DEFAULT]
CS_SEC_ENCRYPTION=CS_TRUE

[isql]

[bcp]

Thanks,
Dawn Kim