为了账号安全,请及时绑定邮箱和手机立即绑定

尝试访问 Microsoft Graph 时出现“无法获得本地颁发者证书”

尝试访问 Microsoft Graph 时出现“无法获得本地颁发者证书”

PHP
米脂 2021-09-18 10:36:50
我想将我的 Symfony4 应用程序配置为使用msgraph-sdk-php库读取和发送电子邮件。我的第一次经历是这段代码:    $guzzle = new \GuzzleHttp\Client();    $url = 'https://login.microsoftonline.com/' . $tenantId . '/oauth2/token?api-version=1.0';    $token = json_decode($guzzle->post($url, [        'form_params' => [            'client_id' => $clientId,            'client_secret' => $clientSecret,            'resource' => 'https://graph.microsoft.com/',            'grant_type' => 'client_credentials',        ],        'verify' => false    ])->getBody()->getContents());    $accessToken = $token->access_token;    $graph = new Graph();    $graph->setAccessToken($accessToken);    try {        $user = $graph->createRequest("GET", "/me")            ->setReturnType(User::class)            ->execute();    } catch (GraphException $e) {        $user=(object) ['getGivenName'=>$e->getMessage()];    }    return "Hello, I am $user->getGivenName() ";但是随后 Symfony 向我显示了一个带有此消息的异常页面:cURL 错误 60:SSL 证书问题:无法获取本地颁发者证书我应该怎么做才能克服这个问题?
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 127 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信