Skip to Content
author's profile photo Former Member
Former Member

Encrypt password to connect Sybase from Perl script

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jul 21, 2016 at 05:05 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 21, 2016 at 02:36 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.