diff --git a/web/documentserver-example/php/config.php b/web/documentserver-example/php/config.php index 91b926b2..bc72d1a9 100644 --- a/web/documentserver-example/php/config.php +++ b/web/documentserver-example/php/config.php @@ -24,6 +24,8 @@ $GLOBALS['DOC_SERV_COMMAND_URL'] = "coauthoring/CommandService.ashx"; $GLOBALS['DOC_SERV_JWT_SECRET'] = ""; $GLOBALS['DOC_SERV_JWT_HEADER'] = "Authorization"; +$GLOBALS['DOC_SERV_VERIFY_PEER_OFF'] = TRUE; + $GLOBALS['EXAMPLE_URL'] = ""; $GLOBALS['MOBILE_REGEX'] = "android|avantgo|playbook|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino"; diff --git a/web/documentserver-example/php/functions.php b/web/documentserver-example/php/functions.php index 8f19c3e9..d35649c9 100644 --- a/web/documentserver-example/php/functions.php +++ b/web/documentserver-example/php/functions.php @@ -175,7 +175,9 @@ function SendRequestToConvertService($document_uri, $from_extension, $to_extensi ); if (substr($urlToConverter, 0, strlen("https")) === "https") { - $opts['ssl'] = array( 'verify_peer' => FALSE ); + if($GLOBALS['DOC_SERV_VERIFY_PEER_OFF'] === TRUE) { + $opts['ssl'] = array( 'verify_peer' => FALSE, 'verify_peer_name' => FALSE ); + } } $context = stream_context_create($opts); diff --git a/web/documentserver-example/php/trackmanager.php b/web/documentserver-example/php/trackmanager.php index f437d458..161153e3 100755 --- a/web/documentserver-example/php/trackmanager.php +++ b/web/documentserver-example/php/trackmanager.php @@ -255,7 +255,9 @@ function commandRequest($method, $key, $meta = null){ )); if (substr($documentCommandUrl, 0, strlen("https")) === "https") { - $opts['ssl'] = array( 'verify_peer' => FALSE ); + if($GLOBALS['DOC_SERV_VERIFY_PEER_OFF'] === TRUE) { + $opts['ssl'] = array( 'verify_peer' => FALSE, 'verify_peer_name' => FALSE ); + } } $context = stream_context_create($opts); diff --git a/web/documentserver-example/php/webeditor-ajax.php b/web/documentserver-example/php/webeditor-ajax.php index 2426539f..99a9c391 100755 --- a/web/documentserver-example/php/webeditor-ajax.php +++ b/web/documentserver-example/php/webeditor-ajax.php @@ -39,6 +39,16 @@ $_trackerStatus = array( 7 => 'CorruptedForceSave' ); +// ignore self-signed certificate +if($GLOBALS['DOC_SERV_VERIFY_PEER_OFF'] === TRUE) { + stream_context_set_default( [ + 'ssl' => [ + 'verify_peer' => false, + 'verify_peer_name' => false, + ], + ]); +} + // check if type value exists if (isset($_GET["type"]) && !empty($_GET["type"])) { $response_array;