oracle/oci-java-sdk

Got HTTP 407 CACHE_ACCESS_DENIED from Squid proxy server when authentication is enabled

lryckman opened this issue · 3 comments

I have client code like in this sample - https://github.com/oracle/oci-java-sdk/blob/master/bmc-examples/src/main/java/HttpProxyExample.java. I am getting Cache Access Denied exception listing regions using IdentityClient. The proxy server is a Squid server. The invocation works correctly if the proxy server authentication is off. Any suggestions? Thank you.

"message": "Failed to list IAM region com.oracle.bmc.model.BmcException: Error returned by ListRegions operation in Identity service.(407, Unknown, false) Unexpected Content-Type: text/html;charset=utf-8 instead of application/json. Response body: <title>ERROR: Cache Access Denied</title> <style type='text/css'></style>

ERROR

Cache Access Denied.


The following error was encountered while trying to retrieve the URL: https://identity.us-phoenix-1.oci.oraclecloud.com/

Cache Access Denied.

Sorry, you are not currently allowed to request https://identity.us-phoenix-1.oci.oraclecloud.com/ from this cache until you have authenticated yourself.

Please contact the cache administrator if you have difficulties authenticating yourself.



Timestamp: 2023-09-18T16:08:10.747Z Client version: Oracle-JavaSDK/3.17.1 Request Endpoint: https://identity.us-phoenix-1.oci.oraclecloud.com/20160918/regions Troubleshooting Tips: See https://docs.oracle.com/en-us/iaas/Content/API/References/apierrors.htm#apierrors_407__407_unknown for more information about resolving this error Also see https://docs.oracle.com/iaas/api/#/en/identity/20160918/Region/ListRegions for details on this operation's requirements. To get more info on the failing request, you can enable debug level logs as mentioned in Using SLF4J for Logging section in https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconfig.htm. If you are unable to resolve this Identity issue, please contact Oracle support and provide them this full error message."

Hi @lryckman , have you tried testing this without SDK, like curl? If it doesn't work with 'curl' then it might be an issue with proxy server configuration rather than a client issue.

Also, can you enable debug logs and share the detailed log?

Thank you for your response. The java sdk team has confirmed that there is a bug in the Jersey3 http client where the proxy password is not extracted correctly. I believe a fix will be available soon. You can consider this item closed.

This has been fixed as part of the latest release. Closing this ticket.