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

1

When doing request to given endpoint , the following error occurs

CREATEORREPLACEPROCEDURECALL_REST_WEBSERV_POST_METHODASV_WLT_DIRECTORYVARCHAR2(4000):='file:/oradisk/app/oracle/product/11.2.0.4/db_1/wallet/Cert_occ_17112019.p7b';V_WLT_PASSWORDVARCHAR2(40):='testeosc1';V_REQUESTUTL_HTTP.REQ;V_RESPONSEUTL_HTTP.RESP;V_TEXTVARCHAR2(2000);CONTENTVARCHAR2(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 encountered this problem? Thank you.

    
asked by anonymous 19.12.2018 / 19:51

1 answer

0

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 .

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 permissions need to be managed and the "portfolios"   stored in the profile are automatically deleted when the profile of the   user is deleted. You can use Oracle Wallet Manager to create   and manage the Wallets in the registry.

Possible solutions:

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

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

Reference:

link

    
19.12.2018 / 22:03