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

fix:SSL_connect rase no protocols available #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/wework/api/methods/message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ def news_message_send user_ids, department_ids, news=[]
message_send user_ids, department_ids, {news: {articles: news}, msgtype: 'news'}
end

def mpnews_message_send user_ids, department_ids, news=[]
message_send user_ids, department_ids, {mpnews: {articles: news}, msgtype: 'mpnews'}
end

def markdown_message_send user_ids, department_ids, content
message_send user_ids, department_ids, {markdown: {content: content}, msgtype: 'markdown'}
end

private

def message_send user_ids, department_ids, payload={}
Expand Down
8 changes: 5 additions & 3 deletions lib/wework/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ class Request
def initialize(base, skip_verify_ssl)
@base = base
@httprb = HTTP.timeout(**Wework.http_timeout_options)
@ssl_context = OpenSSL::SSL::SSLContext.new
@ssl_context.ssl_version = :TLSv1
@ssl_context = OpenSSL::SSL::SSLContext.new
# ssl_version is deprecated and only provided for backwards compatibility. Use #min_version= and #max_version= instead
# @ssl_context.ssl_version = :TLSv1
@ssl_context.min_version = OpenSSL::SSL::TLS1_1_VERSION
@ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE if skip_verify_ssl
end

Expand Down Expand Up @@ -107,4 +109,4 @@ def success?
errcode == SUCCESS_CODE
end
end
end
end