Heroku:UNABLE_TO_GET_ISSUER_CERT_LOCALLY:无法获得本地颁发者证书

时间:2017-01-13 08:04:17

标签: git heroku heroku-toolbelt

我在cli上创建一个新的heroku应用程序时面临问题

C:\sami\foodOrder\foodOrder>heroku create
Creating app... !
 !    UNABLE_TO_GET_ISSUER_CERT_LOCALLY: unable to get local issuer certificate

这甚至发生在现有应用程序的克隆上

3 个答案:

答案 0 :(得分:2)

作为临时解决方法,您可以通过设置环境变量来禁用SSL验证:

HEROKU_SSL_VERIFY=disable

答案 1 :(得分:0)

昨天Heroku通过在使用旧库时引入各种有意但模糊的错误来强制使用新的工具带产品,并且我在升级后遇到了这个问题。我希望其他人也会发现这一点,所以我正在添加我的解决方案。

我已将import 'leaflet'; import './main.scss'; import "reflect-metadata"; import "zone.js/dist/zone"; import "zone.js/dist/long-stack-trace-zone"; import { BrowserModule } from "@angular/platform-browser"; import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; import { Component, NgModule, ComponentRef, Injector, ApplicationRef, ComponentFactoryResolver, Injectable, NgZone } from "@angular/core"; // ########################################### // App component // ########################################### @Component({ selector: "app", template: `<section class="app"><map></map></section>` }) class AppComponent { } // ########################################### // Popup component // ########################################### @Component({ selector: "popup", template: `<section class="popup">Popup Component! :D {{ param }}</section>` }) class PopupComponent { } // ########################################### // Leaflet map service // ########################################### @Injectable() class MapService { map: any; baseMaps: any; markersLayer: any; public injector: Injector; public appRef: ApplicationRef; public resolver: ComponentFactoryResolver; public compRef: any; public component: any; counter: number; init(selector) { this.baseMaps = { CartoDB: L.tileLayer("http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png", { attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> &copy; <a href="http://cartodb.com/attributions">CartoDB</a>' }) }; L.Icon.Default.imagePath = '.'; L.Icon.Default.mergeOptions({ iconUrl: require('leaflet/dist/images/marker-icon.png'), shadowUrl: require('leaflet/dist/images/marker-shadow.png') }); this.map = L.map(selector); this.baseMaps.CartoDB.addTo(this.map); this.map.setView([51.505, -0.09], 13); this.markersLayer = new L.FeatureGroup(null); this.markersLayer.clearLayers(); this.markersLayer.addTo(this.map); } addMarker() { var m = L.marker([51.510, -0.09]); m.bindTooltip('Angular 4 marker (PopupComponent)'); m.bindPopup(null); m.on('click', (e) => { if (this.compRef) this.compRef.destroy(); const compFactory = this.resolver.resolveComponentFactory(this.component); this.compRef = compFactory.create(this.injector); this.compRef.instance.param = 0; setInterval(() => this.compRef.instance.param++, 1000); this.appRef.attachView(this.compRef.hostView); this.compRef.onDestroy(() => { this.appRef.detachView(this.compRef.hostView); }); let div = document.createElement('div'); div.appendChild(this.compRef.location.nativeElement); m.setPopupContent(div); }); this.markersLayer.addLayer(m); return m; } } // ########################################### // Map component. These imports must be made // here, they can't be in a service as they // seem to depend on being loaded inside a // component. // ########################################### @Component({ selector: "map", template: `<section class="map"><div id="map"></div></section>`, }) class MapComponent { marker: any; compRef: ComponentRef<PopupComponent>; constructor( private mapService: MapService, private injector: Injector, private appRef: ApplicationRef, private resolver: ComponentFactoryResolver ) { } ngOnInit() { this.mapService.init('map'); this.mapService.component = PopupComponent; this.mapService.appRef = this.appRef; this.mapService.compRef = this.compRef; this.mapService.injector = this.injector; this.mapService.resolver = this.resolver; this.marker = this.mapService.addMarker(); } } // ########################################### // Main module // ########################################### @NgModule({ imports: [ BrowserModule ], providers: [ MapService ], declarations: [ AppComponent, MapComponent, PopupComponent ], entryComponents: [ PopupComponent ], bootstrap: [AppComponent] }) class AppModule { } platformBrowserDynamic().bootstrapModule(AppModule); 环境变量设置为特定的证书文件以修复this issue with local SSL certs in Ruby on Windows,虽然这对旧的Heroku库有效,但新的需要额外的信任(请参阅SSL_CERT_FILE )。

我的解决方案是删除path/to/Heroku/lib/cacert.pem环境变量,而是使用我现有的Figaro配置文件在我的特定环境中设置它。之后,SSL_CERT_FILE没有问题。

答案 2 :(得分:0)

将以下内容添加到.bowerrc文件...

"registry": "http://bower.herokuapp.com"