Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.2.1"
".": "1.2.2"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.2.2 (2025-11-05)

Full Changelog: [v1.2.1...v1.2.2](https://github.com/OneBusAway/ruby-sdk/compare/v1.2.1...v1.2.2)

### Bug Fixes

* better thread safety via early initializing SSL store during HTTP client creation ([ca9ceed](https://github.com/OneBusAway/ruby-sdk/commit/ca9ceed410e516f1487afb30f84d80eb897cf66f))

## 1.2.1 (2025-11-04)

Full Changelog: [v1.2.0...v1.2.1](https://github.com/OneBusAway/ruby-sdk/compare/v1.2.0...v1.2.1)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
onebusaway-sdk (1.2.1)
onebusaway-sdk (1.2.2)
connection_pool

GEM
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "onebusaway-sdk", "~> 1.2.1"
gem "onebusaway-sdk", "~> 1.2.2"
```

<!-- x-release-please-end -->
Expand Down
1 change: 1 addition & 0 deletions lib/onebusaway_sdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
require "etc"
require "json"
require "net/http"
require "openssl"
require "pathname"
require "rbconfig"
require "securerandom"
Expand Down
8 changes: 6 additions & 2 deletions lib/onebusaway_sdk/internal/transport/pooled_net_requester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ class PooledNetRequester
class << self
# @api private
#
# @param cert_store [OpenSSL::X509::Store]
# @param url [URI::Generic]
#
# @return [Net::HTTP]
def connect(url)
def connect(cert_store:, url:)
port =
case [url.port, url.scheme]
in [Integer, _]
Expand All @@ -33,6 +34,8 @@ def connect(url)
Net::HTTP.new(url.host, port).tap do
_1.use_ssl = %w[https wss].include?(url.scheme)
_1.max_retries = 0

(_1.cert_store = cert_store) if _1.use_ssl?
end
end

Expand Down Expand Up @@ -102,7 +105,7 @@ def build_request(request, &blk)
pool =
@mutex.synchronize do
@pools[origin] ||= ConnectionPool.new(size: @size) do
self.class.connect(url)
self.class.connect(cert_store: @cert_store, url: url)
end
end

Expand Down Expand Up @@ -192,6 +195,7 @@ def execute(request)
def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS)
@mutex = Mutex.new
@size = size
@cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths)
@pools = {}
end

Expand Down
2 changes: 1 addition & 1 deletion lib/onebusaway_sdk/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module OnebusawaySDK
VERSION = "1.2.1"
VERSION = "1.2.2"
end
1 change: 1 addition & 0 deletions manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies:
- etc
- json
- net/http
- openssl
- pathname
- rbconfig
- securerandom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ module OnebusawaySDK

class << self
# @api private
sig { params(url: URI::Generic).returns(Net::HTTP) }
def connect(url)
sig do
params(cert_store: OpenSSL::X509::Store, url: URI::Generic).returns(
Net::HTTP
)
end
def connect(cert_store:, url:)
end

# @api private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ module OnebusawaySDK

DEFAULT_MAX_CONNECTIONS: Integer

def self.connect: (URI::Generic url) -> top
def self.connect: (
cert_store: OpenSSL::X509::Store,
url: URI::Generic
) -> top

def self.calibrate_socket_timeout: (top conn, Float deadline) -> void

Expand Down