Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
cert4android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
3
Snippets
Groups
Projects
Show more breadcrumbs
tasn
cert4android
Commits
3c55eb1f
Commit
3c55eb1f
authored
8 years ago
by
Ricki Hirner
Browse files
Options
Downloads
Patches
Plain Diff
Don't throw an unchecked exception when bindService fails
parent
30b8bc58
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/at/bitfire/cert4android/CustomCertManager.java
+4
-1
4 additions, 1 deletion
src/main/java/at/bitfire/cert4android/CustomCertManager.java
with
4 additions
and
1 deletion
src/main/java/at/bitfire/cert4android/CustomCertManager.java
+
4
−
1
View file @
3c55eb1f
...
...
@@ -110,7 +110,7 @@ public class CustomCertManager implements X509TrustManager, Closeable {
this
.
service
=
service
;
serviceConnection
=
null
;
}
else
if
(!
context
.
bindService
(
new
Intent
(
context
,
CustomCertService
.
class
),
serviceConnection
,
Context
.
BIND_AUTO_CREATE
))
throw
new
IllegalArgumentException
(
"Couldn't bind
s
ervice to
this
context"
);
Constants
.
log
.
severe
(
"Couldn't bind
CustomCertS
ervice to context"
);
}
@Override
...
...
@@ -153,6 +153,9 @@ public class CustomCertManager implements X509TrustManager, Closeable {
protected
void
checkCustomTrusted
(
X509Certificate
cert
)
throws
CertificateException
{
Constants
.
log
.
fine
(
"Querying custom certificate trustworthiness"
);
if
(
service
==
null
)
throw
new
CertificateException
(
"Custom certificate service not available"
);
Message
msg
=
Message
.
obtain
();
msg
.
what
=
CustomCertService
.
MSG_CHECK_TRUSTED
;
int
id
=
msg
.
arg1
=
nextDecisionID
.
getAndIncrement
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment