Skip to content

Commit fbe5c87

Browse files
authored
Merge pull request #96 from marnberg/twoAuth
fixes bug where the cert is set as host
2 parents 18b979a + 3b20784 commit fbe5c87

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

samples/afero-lab/app/src/main/java/io/afero/aferolab/MainActivity.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,17 @@ public void call(ConclaveClient.Status status) {
230230
});
231231

232232
mAferoSofthub = AferoSofthub.acquireInstance(this, mAferoClient, "appId: " + BuildConfig.APPLICATION_ID);
233-
mAferoSofthub.setService(BuildConfig.AFERO_SOFTHUB_SERVICE);
234-
mAferoSofthub.setHost(BuildConfig.AFERO_SERVICE_HOSTNAME);
235-
mAferoSofthub.setHost(BuildConfig.AFERO_SOFTHUB_AUTHENTICATOR_CERT);
233+
if (BuildConfig.AFERO_SOFTHUB_SERVICE != null) {
234+
mAferoSofthub.setService(BuildConfig.AFERO_SOFTHUB_SERVICE);
235+
}
236+
237+
if (BuildConfig.AFERO_SERVICE_HOSTNAME != null) {
238+
mAferoSofthub.setHost(BuildConfig.AFERO_SERVICE_HOSTNAME);
239+
}
240+
241+
if (BuildConfig.AFERO_SOFTHUB_AUTHENTICATOR_CERT != null) {
242+
mAferoSofthub.setAuthCert(BuildConfig.AFERO_SOFTHUB_AUTHENTICATOR_CERT);
243+
}
236244

237245
mAferoSofthub.observeSetupModeDevices()
238246
.observeOn(AndroidSchedulers.mainThread())

0 commit comments

Comments
 (0)