Both the Catalan constant and $\frac{\pi^2}{8}$ are associated with $L(\chi,2)$ Dirichlet series:
$$ G = \sum_{m\geq 0}\frac{(-1)^m}{(2m+1)^2},\qquad \frac{\pi^2}{8}=\sum_{m\geq 0}\frac{1}{(2m+1)^2} $$
hence by denoting with $\chi_0$ and $\chi_1$ the principal and non-principal character $\!\!\pmod{4}$ we have
$$ G = \prod_{p}\left(1-\frac{\chi_1(p)}{p^2}\right)^{-1},\qquad \frac{\pi^2}{8}=\prod_{p}\left(1-\frac{\chi_0(p)}{p^2}\right)^{-1} $$
by Euler's product, such that
$$ \frac{8G}{\pi^2}=\prod_{p}\frac{p^2-\chi_0(p)}{p^2-\chi_1(p)} = \prod_{p\equiv 3\!\!\pmod{\!\!4}}\frac{p^2-1}{p^2+1}$$
as wanted. In a similar fashion
$$ \prod_{p\equiv 3\!\!\pmod{\!\!4}}\frac{p^3-1}{p^3+1}=\frac{\pi^3}{28\,\zeta(3)}$$
due to a well-known identity.