ca-certificates Mac OS X.

 小丸子2502856277_253 发布于 2023-01-04 11:05

我需要在emacs上安装offlineimap和mu4e.问题是配置.当我运行offlineimap时,我得到:

OfflineIMAP 6.5.5
Licensed under the GNU GPL v2+ (v2 or any later version)
Thread 'Account sync Gmail' terminated with exception:
Traceback (most recent call last):
File "/usr/local/Cellar/offline-imap/6.5.6/libexec/offlineimap/threadutil.py", line 158, in   run
Thread.run(self)
File "/anaconda/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/Cellar/offline-imap/6.5.6/libexec/offlineimap/accounts.py", line 226, in  syncrunner
self.remoterepos = Repository(self, 'remote')
File "/usr/local/Cellar/offline-imap/6.5.6/libexec/offlineimap/repository/__init__.py", line 78, in __new__
return repo(name, account)
File "/usr/local/Cellar/offline-imap/6.5.6/libexec/offlineimap/repository/Gmail.py", line 37, in __init__
IMAPRepository.__init__(self, reposname, account)
File "/usr/local/Cellar/offline-imap/6.5.6/libexec/offlineimap/repository/IMAP.py", line 34, in __init__
self.imapserver = imapserver.IMAPServer(self)
File "/usr/local/Cellar/offline-imap/6.5.6/libexec/offlineimap/imapserver.py", line 83, in __init__
self.sslcacertfile = repos.getsslcacertfile()
File "/usr/local/Cellar/offline-imap/6.5.6/libexec/offlineimap/repository/IMAP.py", line 211, in getsslcacertfile
% (self.name, cacertfile))
SyntaxWarning: CA certfile for repository 'Remote' could not be found. No such file: '/usr/share/curl/ca-bundle.crt.original'


Last 2 debug messages logged for Account sync Gmail prior to exception:
thread: Register new thread 'Account sync Gmail' (account 'Gmail')
imap: Using authentication mechanisms ['GSSAPI', 'CRAM-MD5', 'PLAIN', 'LOGIN']

这是我的.offlineimaprc

[general]
accounts = Gmail
maxsyncaccounts = 1
pythonfile = ~/.offlineimap.py

[Account Gmail]
localrepository = Local
remoterepository = Remote

[Repository Local]
type = Maildir
localfolders = ~/Maildir

[Repository Remote]
type = Gmail
remoteuser = enrico.pirani0@gmail.com
remotepasseval = get_password_emacs("imap.gmail.com", "enrico.pirani0@gmail.com", "993")
realdelete = no

folderfilter = lambda foldername: foldername not in ['[Gmail]/Spam', '[Gmail]/All Mail',    '[Gmail]/Starred', '[Gmail]/Important']

holdconnectionopen = true
keepalive = 60
sslcacertfile = /usr/share/curl/ca-bundle.crt.original #??

python安装存在问题,而CA证书存在问题.点是没有任何curl-ca-bundle brew包.我还有其他方法来安装证书吗?

3 个回答
  • 我有一个类似的问题(在MacOS 10.10.2上,openssl 1.0.2和offlineimap 6.5.5都来自自制软件)并且无法使虚拟证书解决方案起作用.但是,我发现了一个使offlineimap停止抱怨的证书文件/usr/local/etc/openssl/cert.pem(通过自制程序安装openssl时放在那里,brew info openssl告诉我).警告:我不知道这是否是一种好的或安全的方法.

    2023-01-04 11:08 回答
  • OS X上通常没有CA证书包,因为SSL库通常在内部使用Apple的安全框架并从Keychain获取证书.

    您可以从Keychain证书创建自己的捆绑包,但是:打开Keychain,导航到"System Roots"钥匙串中的"Certificates"类别,然后按Command + Shift + E("导出项目"),以保存所有证书.我认为Python可以处理PEM格式,所以一定要选择它.

    或者,在OS X 10.6和更新版本上,系统Python是针对OpenSSL版本构建的,OpenSSL版本也始终查看Keychain.因此,您可以创建仅包含虚拟自签名证书的虚拟捆绑包,并在配置中使用该捆绑包使OfflineIMAP关闭.无论如何,它会查看Keychain证书.

    有关详细信息,请参阅https://www.mercurial-scm.org/wiki/CACertificates#Mac_OS_X_10.6_and_higher.

    2023-01-04 11:08 回答
  • 一种简单的方法是使用curl证书包.我使用MacPorts,因此获得了

    sudo port install curl-ca-bundle
    

    然后,您可以运行port contents curl-ca-bundle以查看其安装的内容,然后~/.offlineimaprc在远程帐户的部分中添加以下内容

    sslcacertfile =/opt/local/share/curl/curl-ca-bundle.crt
    

    请注意,这也将链接到这些证书/opt/local/etc/openssl/cert.pem.

    2023-01-04 11:09 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有