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

"HttpURLConnection must not restrict method name" isn't fixed for spring-web [SPR-13672] #18247

Closed
spring-projects-issues opened this issue Nov 9, 2015 · 4 comments
Assignees
Labels
in: web status: declined

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 9, 2015

Viacheslav Tradunskyi opened SPR-13672 and commented

Can't use custom http methods with org.springframework.http.client.SimpleClientHttpRequestFactory:
java.net.ProtocolException: Invalid HTTP method: PATCH

It causes because HttpURLConnection must not restrict method name (see Reference URL)

spring-web-4.2.1.RELEASE
java 1.8

There are some workarounds, one of them:
https://github.com/paypal/sdk-core-java/blob/v1.6.4/src/main/java/com/paypal/core/DefaultHttpConnection.java


Affects: 4.2.2

Reference URL: https://bugs.openjdk.java.net/browse/JDK-7016595

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 11, 2015

Rossen Stoyanchev commented

Moving to the Spring Framework JIRA since SimpleClientHttpRequestFactory is a Spring Framework class (not Spring Web Flow).

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 11, 2015

Rossen Stoyanchev commented

The workaround looks quite unpleasant. Why not switch to one of the ClientHttpRequestFactory implementations like Apache HttpComponents, or Netty, OkHttp?

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 11, 2015

Viacheslav Tradunskyi commented

Actually, I have switched to HttpComponents, anyway SimpleClientHttpRequestFactory is easiest way to implement switcher for temporary ignore ssl errors (hostname verifier, trust manager). I know it's bad idea (potential MITM attacks), but in the case when certificate (maybe self-signed) expired and somebody didn't update it for some reason (no Internet connection, forgot, made a mistake and so on), we should provide max stable and configurable solution (that may work in local network).

Anyway if Spring wont fix it too, it should be deprecated or documented as well.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 17, 2015

Rossen Stoyanchev commented

Not everyone needs HTTP PATCH so that is not a reason to deprecate SimpleClientHttpRequestFactory. In any case this is a JDK vendor issue.

@spring-projects-issues spring-projects-issues added type: bug status: declined in: web labels Jan 11, 2019
@spring-projects-issues spring-projects-issues removed the type: bug label Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web status: declined
Projects
None yet
Development

No branches or pull requests

2 participants