diff --git a/.release-notes/http-0.6.0.md b/.release-notes/http-0.6.0.md new file mode 100644 index 0000000..455444d --- /dev/null +++ b/.release-notes/http-0.6.0.md @@ -0,0 +1,3 @@ +## Update to ponylang/http 0.6.0 + +We've updated our `ponylang/http` dependency to 0.6.0. This includes a fix that will allow correct operation when using OpenSSL 3.2. diff --git a/corral.json b/corral.json index 33afb7d..4abaebc 100644 --- a/corral.json +++ b/corral.json @@ -12,7 +12,7 @@ }, { "locator": "github.com/ponylang/http.git", - "version": "0.5.4" + "version": "0.6.0" }, { "locator": "github.com/ponylang/json.git", diff --git a/github_rest_api/paginated_list.pony b/github_rest_api/paginated_list.pony index 0264f54..352f6a4 100644 --- a/github_rest_api/paginated_list.pony +++ b/github_rest_api/paginated_list.pony @@ -132,12 +132,12 @@ actor PaginatedResultReceiver[A: Any val] // TODO: Could this be more generic? class PaginatedJsonRequester let _auth: TCPConnectAuth - let _client: HTTPClient + let _sslctx: (SSLContext | None) new create(auth: TCPConnectAuth) => _auth = auth - let sslctx = try + _sslctx = try recover val SSLContext.>set_client_verify(true).>set_authority(None)? end @@ -145,8 +145,6 @@ class PaginatedJsonRequester None end - _client = HTTPClient(_auth, sslctx) - fun ref apply[A: Any val](url: String, receiver: PaginatedResultReceiver[A]) ? => @@ -155,7 +153,8 @@ class PaginatedJsonRequester let handler_factory = PaginatedJsonRequesterHandlerFactory[A](_auth, receiver) - _client(consume r, handler_factory)? + let client = HTTPClient(_auth, handler_factory, _sslctx) + client(consume r)? class PaginatedJsonRequesterHandlerFactory[A: Any val] is HandlerFactory let _auth: TCPConnectAuth diff --git a/github_rest_api/request/http_delete.pony b/github_rest_api/request/http_delete.pony index a7a36c6..cfe0d1c 100644 --- a/github_rest_api/request/http_delete.pony +++ b/github_rest_api/request/http_delete.pony @@ -8,10 +8,13 @@ interface tag DeleteResultReceiver be failure(status: U16, response_body: String, message: String) class HTTPDelete - let _client: HTTPClient + let _auth: TCPConnectAuth + let _sslctx: (SSLContext | None) new create(auth: TCPConnectAuth) => - let sslctx = try + _auth = auth + + _sslctx = try recover val SSLContext.>set_client_verify(true).>set_authority(None)? end @@ -19,8 +22,6 @@ class HTTPDelete None end - _client = HTTPClient(auth, sslctx) - fun ref apply(url: String, receiver: DeleteResultReceiver, auth_token: (String | None) = None) ? @@ -29,7 +30,8 @@ class HTTPDelete let r = RequestFactory("DELETE", valid_url, auth_token) let handler_factory = HTTPDeleteHandlerFactory(receiver) - _client(consume r, handler_factory)? + let client = HTTPClient(_auth, handler_factory, _sslctx) + client(consume r)? class HTTPDeleteHandlerFactory is HandlerFactory let _receiver: DeleteResultReceiver diff --git a/github_rest_api/request/http_get.pony b/github_rest_api/request/http_get.pony index 7abae44..a9edc2b 100644 --- a/github_rest_api/request/http_get.pony +++ b/github_rest_api/request/http_get.pony @@ -6,12 +6,12 @@ use "promises" class JsonRequester let _auth: TCPConnectAuth - let _client: HTTPClient + let _sslctx: (SSLContext | None) new create(auth: TCPConnectAuth) => _auth = auth - let sslctx = try + _sslctx = try recover val SSLContext.>set_client_verify(true).>set_authority(None)? end @@ -19,8 +19,6 @@ class JsonRequester None end - _client = HTTPClient(_auth, sslctx) - fun ref apply(url: String, receiver: JsonRequesterResultReceiver) ? => @@ -28,7 +26,8 @@ class JsonRequester let r = RequestFactory("GET", valid_url) let handler_factory = JsonRequesterHandlerFactory(_auth, receiver) - _client(consume r, handler_factory)? + let client = HTTPClient(_auth, handler_factory, _sslctx) + client(consume r)? interface tag JsonRequesterResultReceiver be success(json: JsonDoc val) diff --git a/github_rest_api/request/http_post.pony b/github_rest_api/request/http_post.pony index d1f7da2..7baeec6 100644 --- a/github_rest_api/request/http_post.pony +++ b/github_rest_api/request/http_post.pony @@ -8,10 +8,13 @@ interface tag PostResultReceiver be failure(status: U16, response_body: String, message: String) class HTTPPost - let _client: HTTPClient + let _auth: TCPConnectAuth + let _sslctx: (SSLContext | None) new create(auth: TCPConnectAuth) => - let sslctx = try + _auth = auth + + _sslctx = try recover val SSLContext.>set_client_verify(true).>set_authority(None)? end @@ -19,8 +22,6 @@ class HTTPPost None end - _client = HTTPClient(auth, sslctx) - fun ref apply(url: String, body: String, receiver: PostResultReceiver, @@ -31,7 +32,8 @@ class HTTPPost r.add_chunk(body) let handler_factory = HTTPPostHandlerFactory(receiver) - _client(consume r, handler_factory)? + let client = HTTPClient(_auth, handler_factory, _sslctx) + client(consume r)? class HTTPPostHandlerFactory is HandlerFactory let _receiver: PostResultReceiver