Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verifyCert='no' is not respected, it seems to default to yes regardless #14

Open
mc-zact opened this issue Dec 13, 2022 · 2 comments
Open

Comments

@mc-zact
Copy link

mc-zact commented Dec 13, 2022

Using this

from p3270 import P3270Client

my_client = P3270Client(luName='#LU01', hostName='170.1.2.3', hostPort='1234',
                        modelName='3278-4', verifyCert='no', timeoutInSec=5)

I found that verifyCert would still default to yes, and so this arg is never appended:

            if self.conf.verifyCert == "no":
                self.args.append('-noverifycert')

I'm not quite sure why though didn't really see anything that seemed wrong at first glance, and the other args are not behaving like this

I had to manually edit the code :

    def __init__(self, cfgFile=None, hostName='localhost', hostPort='23',
                 modelName='3279-2', traceFile=None,
                 luName=None, codePage='cp037', screensDir=None, verifyCert='no', enableTLS='no'):

This works

@mike-pt
Copy link
Contributor

mike-pt commented Dec 13, 2022

Able to repo on linux (debian docker image), it seem that conf is not updated to the correct value:

>>> bz_client = P3270Client(hostName='IP', hostPort='1234', verifyCert='no')
>>> bz_client.conf.verifyCert <-----
'yes'
>>> bz_client.verifyCert
'no'

Using vscode break point on if self.conf.verifyCert == "no": I can see that this is always = yes regardless of what is set in the P3270Client as this doesn't seem to get passed to Conf and so it will always fail.

I tried to set bz_client.conf.verifyCert = 'no' after the initialization and before connect but this still does not work.

@mike-pt
Copy link
Contributor

mike-pt commented Dec 13, 2022

Seems the work around is to use a config file instead of passing the params in P3270Client this way the correct config is fully applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants