mirror of https://github.com/MISP/MISP
Use setupHttpSocket for fetchPGPKey
parent
3f74ed0b39
commit
4b5bc3736a
|
@ -526,8 +526,9 @@ class User extends AppModel {
|
|||
}
|
||||
|
||||
public function fetchPGPKey($email) {
|
||||
App::uses('HttpSocket', 'Network/Http');
|
||||
$HttpSocket = new HttpSocket();
|
||||
App::uses('SyncTool', 'Tools');
|
||||
$syncTool = new SyncTool();
|
||||
$HttpSocket = $syncTool->setupHttpSocket();
|
||||
$response = $HttpSocket->get('https://pgp.mit.edu/pks/lookup?search=' . $email . '&op=index&fingerprint=on');
|
||||
if ($response->code != 200) return $response->code;
|
||||
$string = str_replace(array("\r", "\n"), "", $response->body);
|
||||
|
|
Loading…
Reference in New Issue