简体   繁体   English

无法使用p4python连接到启用了SSL的perforce服务器

[英]Cannot connect to a ssl-enabled perforce server using p4python

Python version: 2.7.8 P4Python version: P4PYTHON/NTX86/2014.1/807760 (2014.1/807760 API) (2014/03/18) Client OS: Win2k8 Server Python版本:2.7.8 P4Python版本:P4PYTHON / NTX86 / 2014.1 / 807760(2014.1 / 807760 API)(2014/03/18)客户端操作系统:Win2k8 Server

Python script: Python脚本:

from P4 import P4, P4Exception
p4agent = P4()
p4agent.port = "ssl:my-perforce-server.com:1666"
p4agent.user = "abc"
p4agent.password = "a$3"
p4agent.connect()
p4agent.run_login()

Output: 输出:

Traceback (most recent call last):
  File "C:\Users\Administrator\Desktop\PythonSync\P4Sync.py", line 44, in <module>
    getLatestRevision()
  File "C:\Users\Administrator\Desktop\PythonSync\P4Sync.py", line 41, in getLatestRevision
    initP4()
  File "C:\Users\Administrator\Desktop\PythonSync\P4Sync.py", line 36, in initP4
    p4agent.connect()
  File "c:\python27\lib\site-packages\P4.py", line 678, in connect
    P4API.P4Adapter.connect( self )
P4Exception: [P4.connect()] Connect to server failed; check $P4PORT.
SSL library must be at least version 1.0.1.

p4agent.identify() output: p4agent.identify()输出:

Perforce - The Fast Software Configuration Management System.
Copyright 1995-2014 Perforce Software.  All rights reserved.
This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/)
See 'p4 help legal' for full OpenSSL license information
Version of OpenSSL Libraries: OpenSSL 1.0.1d 5 Feb 2013
Rev. P4PYTHON/NTX86/2014.1/807760 (2014.1/807760 API) (2014/03/18).

The path to OpenSSL (lib) is set in the Path variable. OpenSSL(lib)的路径在Path变量中设置。

I also checked 'p4 set' on the client machine (from where I am trying to connect to the perforce server) and I see that all environment variables are properly set. 我还检查了客户端计算机上的“ p4 set”(尝试从中连接到perforce服务器),并且看到所有环境变量都已正确设置。

Can someone please let me know how to resolve this? 有人可以让我知道如何解决这个问题吗?

I believe the problem is that you are linking with the wrong Openssl library. 我相信问题是您连接了错误的Openssl库。 The output of P4.identify() is misleading: this is the version of the OpenSSL the API was compiled with, not the version you are linking against. P4.identify()的输出具有误导性:这是使用API​​编译的OpenSSL的版本,而不是您要链接的版本。

Where did you get that version of P4Python from? 您从哪里获得该版本的P4Python? Did you compile it yourself or did you download it from some other site? 您是自己编译的还是从其他网站下载的?

If you want to use a ready-made version of P4Python for Windows Python 2.7 and 3.4 32bit and 64bit, please have a look at https://swarm.workshop.perforce.com/projects/p4pythonlib/files/p4pythonlib/bin . 如果要为Windows Python 2.7和3.4 32位和64位使用现成的P4Python版本,请查看https://swarm.workshop.perforce.com/projects/p4pythonlib/files/p4pythonlib/bin Let me know if you have any problems with these builds. 如果您对这些版本有任何疑问,请告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM