gpt4 book ai didi

ruby - 视口(viewport)未在 Ubuntu Server VM 中连接

转载 作者:行者123 更新时间:2023-12-04 19:04:48 24 4
gpt4 key购买 nike

我正在迁移一个通过 EWS 实现用户身份验证的 Redmine 插件。该插件在 Ubuntu 桌面 VM 上运行的 Redmine v4.x 上进行了测试,并且工作正常(可以判断给定的凭据是否有效)。
该插件的主要部分是:

require 'viewpoint'
include Viewpoint::EWS

defaultServer = 'https://company.mail.server/ews/exchange.asmx'
defaultEmailDomain = '@domain.com'

emailAddress = "username" + defaultEmailDomain
password = "password"

client = Viewpoint::EWSClient.new(defaultServer, emailAddress, password)
result = client

begin
client.folders
rescue
result = 'nope'
end

puts result
此代码适用于以前的 VM 和我的 Windows 机器,但在我的新 Ubuntu Server 22.04 VM 上返回“不”。
我还尝试使用可在新 VM 上运行的 exchangelib 在 Python 中编写一个版本。 IMO 表明该问题与 Ubuntu Server 可能具有的任何网络限制无关。
有什么建议么?
更新:
按照理查德的建议,我保存了救援捕获的错误消息。将错误类型更改为 EwsError 后,我得到以下信息:
/usr/lib/ruby/3.0.0/openssl/digest.rb:35:in `initialize': Digest initialization failed: initialization error (OpenSSL::Digest::DigestError)
from /usr/lib/ruby/3.0.0/openssl/digest.rb:35:in `block (3 levels) in <class:Digest>'
from /usr/lib/ruby/3.0.0/openssl/digest.rb:41:in `new'
from /usr/lib/ruby/3.0.0/openssl/digest.rb:41:in `block (3 levels) in <class:Digest>'
from /var/lib/gems/3.0.0/gems/rubyntlm-0.6.3/lib/net/ntlm.rb:149:in `ntlm_hash'
from /var/lib/gems/3.0.0/gems/rubyntlm-0.6.3/lib/net/ntlm.rb:162:in `ntlmv2_hash'
from /var/lib/gems/3.0.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message/type2.rb:73:in `response'
from /var/lib/gems/3.0.0/gems/httpclient-2.8.3/lib/httpclient/auth.rb:563:in `block in get'
from /usr/lib/ruby/3.0.0/mutex_m.rb:78:in `synchronize'
from /usr/lib/ruby/3.0.0/mutex_m.rb:78:in `mu_synchronize'
from /var/lib/gems/3.0.0/gems/httpclient-2.8.3/lib/httpclient/auth.rb:537:in `get'
from /var/lib/gems/3.0.0/gems/httpclient-2.8.3/lib/httpclient/auth.rb:97:in `block in filter_request'
from /var/lib/gems/3.0.0/gems/httpclient-2.8.3/lib/httpclient/auth.rb:95:in `each'
from /var/lib/gems/3.0.0/gems/httpclient-2.8.3/lib/httpclient/auth.rb:95:in `filter_request'
from /var/lib/gems/3.0.0/gems/httpclient-2.8.3/lib/httpclient.rb:1231:in `block in do_get_block'
from /var/lib/gems/3.0.0/gems/httpclient-2.8.3/lib/httpclient.rb:1230:in `each'
from /var/lib/gems/3.0.0/gems/httpclient-2.8.3/lib/httpclient.rb:1230:in `do_get_block'
from /var/lib/gems/3.0.0/gems/httpclient-2.8.3/lib/httpclient.rb:1019:in `block in do_request'
from /var/lib/gems/3.0.0/gems/httpclient-2.8.3/lib/httpclient.rb:1133:in `protect_keep_alive_disconnected'
from /var/lib/gems/3.0.0/gems/httpclient-2.8.3/lib/httpclient.rb:1014:in `do_request'
from /var/lib/gems/3.0.0/gems/httpclient-2.8.3/lib/httpclient.rb:856:in `request'
from /var/lib/gems/3.0.0/gems/httpclient-2.8.3/lib/httpclient.rb:765:in `post'
from /var/lib/gems/3.0.0/gems/viewpoint-1.1.1/lib/ews/connection.rb:103:in `post'
from /var/lib/gems/3.0.0/gems/viewpoint-1.1.1/lib/ews/connection.rb:81:in `dispatch'
from /var/lib/gems/3.0.0/gems/viewpoint-1.1.1/lib/ews/soap/exchange_web_service.rb:212:in `do_soap_request'
from /var/lib/gems/3.0.0/gems/viewpoint-1.1.1/lib/ews/soap/exchange_data_services.rb:503:in `find_folder'
from /var/lib/gems/3.0.0/gems/viewpoint-1.1.1/lib/ews/folder_accessors.rb:45:in `folders'
from /home/jdredd/auth_source_ews/app/models/test.rb:27:in `<main>'
附加信息:成功运行用户身份验证的 Windows 测试机器具有与上述相同的 gem 版本。唯一的区别是 Ruby 本身的版本(Ubuntu 上为 3.0.2p107,Windows 上为 3.1.2p20)。
更新:
根据 this diff修改openssl.cnf后启用加载旧提供程序,该插件现在可以工作。

最佳答案

尝试调查错误消息。

begin
client.folders
rescue StandardError => err
puts err
result = 'nope'
end
https://thoughtbot.com/blog/rescue-standarderror-not-exception

关于ruby - 视口(viewport)未在 Ubuntu Server VM 中连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72617091/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com