Skip to content

Commit 471bd59

Browse files
API-SSL without certificate
In the case no certificate is used in '/ip service' settings then anonymous Diffie-Hellman cipher have to be used to establish connection. Source: http://wiki.mikrotik.com/wiki/Manual:API-SSL --- Version:5.6.0 Description: Added peer_fingerprint and verify_peer_name. verify_peer default changed to TRUE. Source: http://php.net/manual/en/context.ssl.php --- The function stream_socket_client() is similar but provides a richer set of options, including non-blocking connection and the ability to provide a stream context. Source: http://php.net/manual/en/function.fsockopen.php --- 'ciphers' => 'ADH:ALL' Source:https://wiki.openssl.org/index.php/Manual:Ciphers(1)
1 parent 96c67d8 commit 471bd59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routeros_api.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function connect($ip, $login, $password)
9797
for ($ATTEMPT = 1; $ATTEMPT <= $this->attempts; $ATTEMPT++) {
9898
$this->connected = false;
9999
$PROTOCOL = ($this->ssl ? 'ssl://' : '' );
100-
$context = stream_context_create(['ssl' => ['ciphers' => 'ADH', 'verify_peer' => false, 'verify_peer_name' => false]]);
100+
$context = stream_context_create(['ssl' => ['ciphers' => 'ADH:ALL', 'verify_peer' => false, 'verify_peer_name' => false]]);
101101
$this->debug('Connection attempt #' . $ATTEMPT . ' to ' . $PROTOCOL . $ip . ':' . $this->port . '...');
102102
$this->socket = @stream_socket_client($PROTOCOL . $ip.':'. $this->port, $this->error_no, $this->error_str, $this->timeout, STREAM_CLIENT_CONNECT,$context);
103103
if ($this->socket) {

0 commit comments

Comments
 (0)