  Let $S$ be a convex hypersurface (the boundary of a closed convex set $V$
with nonempty interior) in $\mathbb{R}^n$. We prove that $S$ contains no lines
if and only if for every open set $U\supset S$ there exists a real-analytic
convex hypersurface $S_{U} \subset U\cap \textrm{int}(V) $. We also show that
$S$ contains no rays if and only if for every open set $U\supset S$ there
exists a real-analytic convex hypersurface $S_{U}\subset U\setminus V$.
Moreover, in both cases, $S_U$ can be taken strongly convex. We also establish
similar results for convex functions defined on open convex subsets of
$\mathbb{R}^n$, completely characterizing the class of convex functions that
can be approximated in the $C^0$-fine topology by smooth convex functions from
above or from below. We also provide similar results for $C^1$-fine
approximations
