Explicitly set TLSv1.2 in httpclient request in Angular

a 夏天 提交于 2021-01-29 12:07:27

问题


I am new to SSl/TLS protocols.I have back-end(API) wich is TLSv1.2 enabled. What I want to do is set the tls version for each and every request of my front-end(Angular) application.I want to prove that my application capable of sending TLSv1.2 request.Is there any way to set TLS version in angular web api request.Then i can change the TLS version and prove that.

This is how consume web API.

  public methodName(): Observable<any[]> {
  return this.http
  .get<any>(`${config.apiUrl}url`)
  .pipe(
    map(data =>
      data.map(m => {
          return m;
      })
    ),
    catchError(error => {
      this.notificationServiceService.OpenErrorSnackBar(error.message);
      return of(any[0]);
    })
  );

And i have TokenIntercepter to add token for each request. This is how i did it.

request.clone({
  setHeaders: {
    Authorization: `Bearer ${token}`,
    }
});

Any suggestions are welcome to fix this issue.

来源:https://stackoverflow.com/questions/60863817/explicitly-set-tlsv1-2-in-httpclient-request-in-angular

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!