Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix root cert color when self-signed #4912

Merged
merged 3 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/src/web-scan/objects/tls-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ export const certificateChainInfoType = new GraphQLObjectType({
type: new GraphQLList(certificateType),
description: `The certificate chain which was used to create the TLS connection.`,
},
passedValidation: {
type: GraphQLBoolean,
description: `Whether or not the certificate chain passed validation.`,
},
}),
})

Expand Down
3 changes: 3 additions & 0 deletions frontend/mocking/faked_schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,9 @@ export const getTypeNames = () => gql`

# The certificate chain which was used to create the TLS connection.
certificateChain: [Certificate]

# Whether or not the certificate chain passed validation.
passedValidation: Boolean
}

# Validation results from each trust store.
Expand Down
1 change: 1 addition & 0 deletions frontend/src/graphql/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ export const DOMAIN_GUIDANCE_PAGE = gql`
receivedChainHasValidOrder
verifiedChainHasSha1Signature
verifiedChainHasLegacySymantecAnchor
passedValidation
certificateChain {
notValidBefore
notValidAfter
Expand Down
23 changes: 19 additions & 4 deletions frontend/src/guidance/WebTLSResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export function WebTLSResults({ tlsResult }) {
verifiedChainHasLegacySymantecAnchor,
certificateChain,
pathValidationResults,
passedValidation,
} = tlsResult?.certificateChainInfo || {}

const { robotVulnerable, heartbleedVulnerable } = tlsResult
Expand Down Expand Up @@ -382,8 +383,19 @@ export function WebTLSResults({ tlsResult }) {
px="2"
my="2"
borderWidth="1px"
bg={expiredCert || certRevoked || selfSignedCert ? 'weakMuted' : 'gray.100'}
borderColor={expiredCert || certRevoked || selfSignedCert ? 'weak' : 'gray.300'}
bg={
expiredCert ||
certRevoked ||
(selfSignedCert && !passedValidation) ||
(badHostname && idx === 0)
? 'weakMuted'
: 'gray.100'
}
borderColor={
expiredCert || certRevoked || (selfSignedCert && !passedValidation)
? 'weak'
: 'gray.300'
}
>
<Text fontWeight="bold">
{idx + 1}. {commonNames[0]}
Expand Down Expand Up @@ -424,8 +436,8 @@ export function WebTLSResults({ tlsResult }) {
<Trans>Issuer:</Trans> {issuer}
</Text>
<Text
fontWeight={selfSignedCert ? 'bold' : ''}
color={selfSignedCert ? 'weak' : 'black'}
fontWeight={selfSignedCert && !passedValidation ? 'bold' : ''}
color={selfSignedCert && !passedValidation ? 'weak' : 'black'}
>
<Trans>Self-signed:</Trans> {selfSignedCert ? t`Yes` : t`No`}
</Text>
Expand All @@ -448,6 +460,9 @@ export function WebTLSResults({ tlsResult }) {
)
})}
</Flex>
<Text fontWeight={badHostname ? 'bold' : ''} color={badHostname ? 'weak' : 'black'}>
<Trans>Hostname Matches: {badHostname ? t`No` : t`Yes`}</Trans>
</Text>
</AccordionPanel>
</Box>
</AccordionItem>
Expand Down
Loading