// Read the data from the response body
try {
$response = $this->client->get($remote . '/ocs-provider/', [
- 'timeout' => 3,
- 'connect_timeout' => 3,
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
]);
if($response->getStatusCode() === 200) {
$decodedService = json_decode($response->getBody(), true);
try {
$response = $client->post($protocol . $remoteDomain . $endpoint . $urlSuffix . '?format=' . self::RESPONSE_FORMAT, [
'body' => $fields,
- 'timeout' => 3,
- 'connect_timeout' => 3,
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
]);
$result['result'] = $response->getBody();
$result['success'] = true;
$this->client
->expects($this->once())
->method('get')
- ->with('https://myhost.com/ocs-provider/', [])
+ ->with('https://myhost.com/ocs-provider/', [
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
+ ])
->willReturn($response);
$this->cache
->expects($this->at(0))
$this->client
->expects($this->once())
->method('get')
- ->with('https://myhost.com/ocs-provider/', [])
+ ->with('https://myhost.com/ocs-provider/', [
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
+ ])
->willReturn($response);
$expectedResult = '/public.php/MyCustomEndpoint/';
$this->client
->expects($this->once())
->method('get')
- ->with('https://myhost.com/ocs-provider/', [])
+ ->with('https://myhost.com/ocs-provider/', [
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
+ ])
->willReturn($response);
$expectedResult = '/public.php/webdav';
$this->client
->expects($this->once())
->method('get')
- ->with('https://myhost.com/ocs-provider/', [])
+ ->with('https://myhost.com/ocs-provider/', [
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
+ ])
->willReturn($response);
$expectedResult = '/ocs/v2.php/cloud/MyCustomShareEndpoint';
$this->client
->expects($this->once())
->method('get')
- ->with('https://myhost.com/ocs-provider/', [])
+ ->with('https://myhost.com/ocs-provider/', [
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
+ ])
->willReturn($response);
$this->cache
->expects($this->at(0))
if (substr($remote, 0, 5) === 'https') {
try {
\OC::$server->getHTTPClientService()->newClient()->get($remote, [
- 'timeout' => 3,
- 'connect_timeout' => 3,
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
])->getBody();
} catch (\Exception $e) {
\OCP\JSON::error(array('data' => array('message' => $l->t('Invalid or untrusted SSL certificate'))));
$client = $this->httpClient->newClient();
try {
$result = $client->get($url, [
- 'timeout' => 3,
- 'connect_timeout' => 3,
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
])->getBody();
$data = json_decode($result);
$returnValue = (is_object($data) && !empty($data->version));
try {
$response = $client->post($url, [
'body' => ['password' => $password],
- 'timeout' => 3,
- 'connect_timeout' => 3,
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
]);
} catch (\GuzzleHttp\Exception\RequestException $e) {
if ($e->getCode() === 401 || $e->getCode() === 403) {