Error making UTL_HTTP request. ORA-28759: Failure to open file

Asked

Viewed 763 times

1

By making a request the determined endpoint, error occurs below inserir a descrição da imagem aqui

CREATE OR REPLACE PROCEDURE CALL_REST_WEBSERV_POST_METHOD
    AS V_WLT_DIRECTORY
    VARCHAR2(4000) := 'file:/oradisk/app/oracle/product/11.2.0.4/db_1/wallet/Cert_occ_17112019.p7b';
    V_WLT_PASSWORD              VARCHAR2(40) := 'testeosc1';
    V_REQUEST    UTL_HTTP.REQ;
    V_RESPONSE   UTL_HTTP.RESP;
    V_TEXT       VARCHAR2(2000);
    CONTENT VARCHAR2(4000) :='{
        "values": [
            {
                "key": "occ-env",
                "value": "https://admin-admin",
                "enabled": true
            },
            {
                "key": "occ-user",
                "value": "meuusuario@tofodido",
                "enabled": true
            },
            {
                "key": "occ-password",
                "value": "xxxxxxx",
                "enabled": true
            },
            {
                "key": "occ-key",
                "value": "000000",
                "description": {
                    "content": "",
                    "type": "text/plain"
                },
                "enabled": true
             }
         ],
    }' ;

BEGIN

    DBMS_OUTPUT.PUT_LINE('Passou 1'); 

    UTL_HTTP.SET_WALLET(V_WLT_DIRECTORY
        ,V_WLT_PASSWORD);

    DBMS_OUTPUT.PUT_LINE('Passou 2'); 

    V_REQUEST := UTL_HTTP.BEGIN_REQUEST('https://meu_endpointblablabla/'
        ,'POST'
        ,'HTTP/1.1');

    DBMS_OUTPUT.PUT_LINE('Passou 3'); 


    UTL_HTTP.SET_HEADER(V_REQUEST, 'Content-Type', 'application/x-www-form-urlencoded');
    UTL_HTTP.SET_HEADER(V_REQUEST, 'Authorization', 'OAuth');
    UTL_HTTP.SET_HEADER(V_REQUEST, 'Content-Length', LENGTH(CONTENT));

    UTL_HTTP.WRITE_TEXT(V_REQUEST, CONTENT);

    V_RESPONSE := UTL_HTTP.GET_RESPONSE(V_REQUEST);

    DBMS_OUTPUT.PUT_LINE('Resposta status : ' || V_RESPONSE.STATUS_CODE);
    DBMS_OUTPUT.PUT_LINE('Resposta rasão: '   || V_RESPONSE.REASON_PHRASE);


    LOOP
        BEGIN
            UTL_HTTP.READ_TEXT(V_RESPONSE, V_TEXT);
            DBMS_OUTPUT.PUT_LINE(V_TEXT);
            EXCEPTION
                WHEN UTL_HTTP.END_OF_BODY THEN
                    NULL;
                END;

        EXIT WHEN V_TEXT IS NULL;
    END LOOP;

    UTL_HTTP.END_RESPONSE(V_RESPONSE);
END; 

Has anyone ever come across this problem? Thank you.

1 answer

1


I have no experience with Wallet manager, but based on some cases I found on the internet I will try to help you with the error ORA-28759.

The Wallet Manager gives read, write and modify permissions only to the user who created the file.

Wallets are Associated with specific user profiles, so no file Permissions need to be Managed, and the wallets stored in the profile are Automatically Deleted when the user profile is Deleted. You can use Oracle Wallet Manager to create and Manage the wallets in the Registry.

Free translation:

Wallets are associated with specific user profiles, therefore, no file permission needs to be managed and the "wallets" stored in the profile are automatically deleted when the profile user is deleted. You can use Oracle Wallet Manager to create and manage the Wallets on the record.

Possible solutions:

  • Modify permissions or copy files to another location. Then in SET_WALLET refer to the new file location that in your case is in the V_WLT_DIRECTORY.
  • Check if the path of wallet is accessible from the database server data and what permissions it has in the directory.
  • Check that auto_login is enabled. If Wallet has the auto_login enabled, the password may be omitted and must be set to NULL.

  • Check your SQLNET file. (SQLNET.WALLET_OVERRIDE, SSL_CLIENT_AUTHENTICATION, SSL_VERSION)

Reference:

https://docs.oracle.com/cd/E11882_01/appdev.112/e40758/u_http.htm#ARPLS71106

  • Hello George, good morning. We gave the permissions for the file and we had no success in the operation. The problem with changing Wallet’s location is that we have two more certificates for Oracle Sales Cloud and Sales Force. If you change, both systems will stop working because you will lose the address already assigned.

  • @Johnleenda put a few more checks, Check if something will solve your problem.

  • None of the Methods worked unfortunately. :(

  • George came here to say that now it worked.. we took on the project and worked out 3 solution

  • Good @Goldenboy, I’m glad I helped you! When possible mark as answer since solved your problem. And if possible give the vote to keep me encouraged! kkk ;)

  • done, thank you very much for the same help

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.