| 726 | self._curl_headerfiles_n = 0 |
| 727 | |
| 728 | def curl_resolve_args(self, url, insecure=False, force_resolve=True, options=None): |
| 729 | u = urlparse(url) |
| 730 | |
| 731 | args = [ |
| 732 | ] |
| 733 | if u.scheme == 'http': |
| 734 | pass |
| 735 | elif insecure: |
| 736 | args.append('--insecure') |
| 737 | elif options and "--cacert" in options: |
| 738 | pass |
| 739 | elif u.hostname: |
| 740 | ca_pem = self.get_ca_pem_file(u.hostname) |
| 741 | if ca_pem: |
| 742 | args.extend(["--cacert", ca_pem]) |
| 743 | |
| 744 | if force_resolve and u.hostname and u.hostname != 'localhost' \ |
| 745 | and u.hostname != self._httpd_addr \ |
| 746 | and not re.match(r'^(\d+|\[|:).*', u.hostname): |
| 747 | assert u.port, f"port not in url: {url}" |
| 748 | args.extend(["--resolve", f"{u.hostname}:{u.port}:{self._httpd_addr}"]) |
| 749 | return args |
| 750 | |
| 751 | def curl_complete_args(self, urls, stdout_list=False, |
| 752 | timeout=None, options=None, |