diff --git a/airflow/providers/hashicorp/_internal_client/vault_client.py b/airflow/providers/hashicorp/_internal_client/vault_client.py index ea8aaf0071230..084b4927ed2db 100644 --- a/airflow/providers/hashicorp/_internal_client/vault_client.py +++ b/airflow/providers/hashicorp/_internal_client/vault_client.py @@ -190,7 +190,16 @@ def _client(self) -> hvac.Client: :return: Vault Client """ - _client = hvac.Client(url=self.url, **self.kwargs) + adapter = HTTPAdapter(max_retries=Retry( + total=3, + backoff_factor=1, + status_forcelist=[412, 500, 502, 503], + raise_on_status=False, + )) + session = Session() + session.mount("http://", adapter) + session.mount("https://", adapter) + _client = hvac.Client(url=self.url, session=session, **self.kwargs) if self.auth_type == "approle": self._auth_approle(_client) elif self.auth_type == "aws_iam":