I forgot to mention, the site is not online yet, and I am using docker for development. The official WordPress image.
Hello @antoniovaldezarce,
thank you for your message and for using our plugin.
The error message is pretty clear however, for whatever reason the plugin cannot reach the WSDL file. Most often the issue is solved by opening up specific ports towards the outside.
Have you tried the port checker inside the plugin settings?
Hi @drazenbebic, thank you for your quick response!
The quick answer is yes, I checked the Port-Checker tool and it shows that all the ports are open:
Ports
tcp://www.deutschepost.de:443 Opened
tcp://internetmarke.deutschepost.de:443 Opened
tcp://prodws.deutschepost.de:443 Opened
tcp://prodws.deutschepost.de:8443 Opened
udp://www.deutschepost.de:443 Opened
udp://www.deutschepost.de:8443 Opened
udp://internetmarke.deutschepost.de:443 Opened
udp://internetmarke.deutschepost.de:8443 Opened
udp://prodws.deutschepost.de:443 Opened
udp://prodws.deutschepost.de:8443 Opened
Last port check 2019-11-14, 08:13:53
In order to remove the error and do a test, I downloaded the WSDL into a local file like this:
/includes/connectors/soap/OC4A.php
...
protected function init($email, $password)
{
$this->namespace = 'http://oneclickforapp.dpag.de/V3';
// $this->wsdl = 'https://internetmarke.deutschepost.de/OneClickForAppV3?wsdl';
$this->wsdl = 'http://localhost/OneClickForAppV3.xml';
if ($email == null || $password == null) {
$credentials = $this->user_repository->getCredentials();
$this->email = $credentials['email'];
$this->password = $credentials['password'];
} else {
$this->email = $email;
$this->password = $password;
}
}
I also changed it in the same way in the file /includes/connectors/soap/OC4R.php
Obviously, the WSDL is now loaded, but I get other errors when I try to save the account settings.
Furthermore, when I run this curl https://internetmarke.deutschepost.de/OneClickForAppV3?wsdl in the docker container terminal the WSDL is correctly loaded.
Thanks again for your help!
@antoniovaldezarce
Obviously, the WSDL is now loaded, but I get other errors when I try to save the account settings.
Do you have a specific error message? This part is interesting.
Also, try linking to this specific .wsdl file instead of the downloaded XML:
https://easyupload.io/l0kr0a
Let me know if that works.
I downloaded the .wsdl file you provided but no luck.
When I try to save the “Portokasse” account settings (email, password), I get the error message Could not connect to host.
Do I need to use the https protocol in my website in order to be able to connect?
Hello @antoniovaldezarce,
now that is odd, I have tried replacing the URL to the WSDL file and it worked fine on my end. My best guess is, that it is related to the docker environment itself, I just don’t know the exact cause.
Could you please try and enable the plugin logger? You can find it in the “Internetmarke – Settings – Tools – Logging” menu. Afterwards try logging in and please check if there is any more detialed error message inside that log file.
Hey @drazenbebic,
I also suspect is related to docker.
Anyway, I enabled the Logging, and I tried to save the Portkasse credentials and got this trace:
wp-content/plugins/woo-dp-internetmarke/includes/Logger.php:327
Exception thrown at: 2019-11-14 10:24
Message: Could not connect to host
Code: 0
Thrown at: /var/www/html/wp-content/plugins/woo-dp-internetmarke/includes/connectors/soap/OC4A.php:175
Trace:
[0] SoapClient->__doRequest() | :
[1] SoapClient->__soapCall() | /var/www/html/wp-content/plugins/woo-dp-internetmarke/includes/connectors/soap/OC4A.php:175
[2] WCDPI\Connectors\SOAP\OC4A->authenticateUser() | /var/www/html/wp-content/plugins/woo-dp-internetmarke/includes/settings/Portokasse.php:224
[3] WCDPI\Settings\Portokasse->sanitizeSettings() | /var/www/html/wp-includes/class-wp-hook.php:288
[4] WP_Hook->apply_filters() | /var/www/html/wp-includes/plugin.php:208
[5] apply_filters() | /var/www/html/wp-includes/formatting.php:4724
[6] sanitize_option() | /var/www/html/wp-includes/option.php:306
[7] update_option() | /var/www/html/wp-admin/options.php:283
The exception is in this line:
return $this->__soapCall(
'authenticateUser', array(
'AuthenticateUserRequest' => array(
'username' => $email,
'password' => $password
)
)
);
I checked the username and password, and they are the ones I provided. The key_phase, market_key and partner_id are also assigned.
Somehow the soap connection is failing.
Hi @drazenbebic,
I managed to connect. The issue was in the docker image indeed. It turns out the image has a newer version of openssl on Debian which has raised the TLS security level to 2, which requires DHE at 2048-bit or higher for the encrypted exchanges.
What I did is to reduce the security level to 1 in the file /etc/ssl/openssl.cnf:
so, from this:
CipherString = DEFAULT:@SECLEVEL=2
to this:
CipherString = DEFAULT:@SECLEVEL=1
And now it connects correctly. I know reducing the TLS security doesn’t sound ideal, but it’s a workaround for development purposes.
the error message now is Unknown user or invalid password but that’s another story.
Thanks a lot for your help!
@antoniovaldezarce,
that’s good to know for us as well, thank you for your investigative work on this – good job!
Should you have any other questions do not hesitate to ask us.